Skip to content

Commit

Permalink
fix: raise for non-2xx status
Browse files Browse the repository at this point in the history
  • Loading branch information
umonaca committed Dec 1, 2021
1 parent 9b72de3 commit 192c2c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions obplatform/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def list_behaviors(self) -> List[Dict[str, Any]]:
this module to query and download the data from the database.
"""
response = self.session.get(self.endpoint + "/api/v1/behaviors")
response.raise_for_status()
return response.json() # type: ignore

def _start_export_job(self, behavior_ids: List[str], studies: List[str]) -> str:
Expand Down Expand Up @@ -202,7 +203,7 @@ def list_behaviors_in_studies(
"""
payload = self._get_payload({"studies": studies})
response = self.session.get(self.endpoint + "/api/v1/behaviors", params=payload)

response.raise_for_status()
return response.json() # type: ignore

def list_studies(
Expand Down Expand Up @@ -255,7 +256,7 @@ def list_studies(
}
)
response = self.session.get(self.endpoint + "/api/v1/studies", params=payload)

response.raise_for_status()
return response.json()


Expand Down

0 comments on commit 192c2c9

Please sign in to comment.