Skip to content

Commit

Permalink
feat: check response return codes after the error state
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Dec 8, 2024
1 parent 83d52c8 commit cb9cfee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

[0.5.1] - Unreleased
--------------------

Changed
^^^^^^^
- Check response return codes after the error state.
This helps providing more useful error messages.

[0.5.0] - 2024-12-06
--------------------

Expand Down
4 changes: 3 additions & 1 deletion scim2_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ def check_response(
if raise_scim_errors is None:
raise_scim_errors = self.raise_scim_errors

self._check_status_codes(status_code, expected_status_codes)
self._check_content_types(headers)

# In addition to returning an HTTP response code, implementers MUST return
Expand All @@ -283,6 +282,7 @@ def check_response(
check_response_payload = self.check_response_payload

if not check_response_payload:
self._check_status_codes(status_code, expected_status_codes)
return response_payload

if (
Expand All @@ -294,6 +294,8 @@ def check_response(
raise SCIMResponseErrorObject(obj=error.detail, source=error)
return error

self._check_status_codes(status_code, expected_status_codes)

if not expected_types:
return response_payload

Expand Down

0 comments on commit cb9cfee

Please sign in to comment.