Skip to content

Use scim2-models exception classes - #40

Merged
azmeuk merged 3 commits into
mainfrom
39-scim2-models-exceptions
Sep 20, 2026
Merged

azmeuk merged 3 commits into
mainfrom
39-scim2-models-exceptions

Conversation

@azmeuk

@azmeuk azmeuk commented Feb 5, 2026

Copy link
Copy Markdown
Member

fix #39

@azmeuk azmeuk changed the title Use scim2-models exceptions Use scim2-models exception classes Feb 5, 2026
@azmeuk
azmeuk force-pushed the 39-scim2-models-exceptions branch from fdeac8b to fff8fad Compare February 5, 2026 13:54
Invalid request payloads and server Error objects now raise the
scim2_models.SCIMException subclass matching their scimType, instead of
scim2-client specific exceptions. The exceptions that describe transport
and protocol failures stay in scim2_client, renamed with an Exception
suffix.

The status and the scimType the server sent are restored on the
exception, because scim2_models.SCIMException.from_error() rebuilds them
from the exception class and loses everything it has no class for.

fix #39
The renamed exceptions keep their former name as a module attribute
served by a module __getattr__, so that an except block written against
the old name still catches what the client raises, while importing that
name warns about the rename.

Subclassing would have been silent: the client raises the parent, which
an except on a subclass never catches.
The tutorial and the README now catch scim2_models.SCIMException, and
the tutorial tells apart the exceptions a server response builds, which
carry that response, from the ones the local payload validation raises.
@azmeuk
azmeuk force-pushed the 39-scim2-models-exceptions branch from fff8fad to 7e57689 Compare September 20, 2026 11:21
@azmeuk
azmeuk merged commit 4ad1134 into main Sep 20, 2026
8 checks passed
@azmeuk
azmeuk deleted the 39-scim2-models-exceptions branch September 20, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt the scim2-models exception classes

1 participant