diff --git a/src/groundlight/internalapi.py b/src/groundlight/internalapi.py index 10a3c27e..95243cd9 100644 --- a/src/groundlight/internalapi.py +++ b/src/groundlight/internalapi.py @@ -320,10 +320,7 @@ def update_inspection_metadata(self, inspection_id: str, user_provided_key: str, http_resp=response, ) if response.json()["status"] == "COMPLETE": - raise InternalApiError( - # status=response.status_code, - reason=f"Inspection {inspection_id} is closed. Metadata cannot be added.", - ) + raise ValueError(f"Inspection {inspection_id} is closed. Metadata cannot be added.") payload = {} diff --git a/test/integration/test_groundlight.py b/test/integration/test_groundlight.py index 55ca43dd..5c836714 100644 --- a/test/integration/test_groundlight.py +++ b/test/integration/test_groundlight.py @@ -451,7 +451,7 @@ def test_update_inspection_metadata_failure(gl: Groundlight): _ = gl.stop_inspection(inspection_id) - with pytest.raises(InternalApiError): + with pytest.raises(ValueError): user_provided_key = "Inspector" user_provided_value = "Bob" gl.update_inspection_metadata(inspection_id, user_provided_key, user_provided_value)