Skip to content

Commit cb9cfee

Browse files
committed
feat: check response return codes after the error state
1 parent 83d52c8 commit cb9cfee

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
[0.5.1] - Unreleased
5+
--------------------
6+
7+
Changed
8+
^^^^^^^
9+
- Check response return codes after the error state.
10+
This helps providing more useful error messages.
11+
412
[0.5.0] - 2024-12-06
513
--------------------
614

scim2_client/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ def check_response(
265265
if raise_scim_errors is None:
266266
raise_scim_errors = self.raise_scim_errors
267267

268-
self._check_status_codes(status_code, expected_status_codes)
269268
self._check_content_types(headers)
270269

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

285284
if not check_response_payload:
285+
self._check_status_codes(status_code, expected_status_codes)
286286
return response_payload
287287

288288
if (
@@ -294,6 +294,8 @@ def check_response(
294294
raise SCIMResponseErrorObject(obj=error.detail, source=error)
295295
return error
296296

297+
self._check_status_codes(status_code, expected_status_codes)
298+
297299
if not expected_types:
298300
return response_payload
299301

0 commit comments

Comments
 (0)