diff --git a/dcicutils/portal_utils.py b/dcicutils/portal_utils.py index 2bd19f4c9..833a04226 100644 --- a/dcicutils/portal_utils.py +++ b/dcicutils/portal_utils.py @@ -342,6 +342,9 @@ def __getattr__(self, attr): # noqa return getattr(self._response, attr) def json(self): # noqa return self._response.json + def raise_for_status(self): # noqa + if self.status_code < 200 or self.status_code > 399: + raise requests.exceptions.HTTPError(f"HTTP Error: {self.status_code}", response=self) response = TestResponseWrapper(response) return response