Use scim2-models exception classes - #40
Merged
Merged
Conversation
azmeuk
force-pushed
the
39-scim2-models-exceptions
branch
from
February 5, 2026 13:54
fdeac8b to
fff8fad
Compare
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
force-pushed
the
39-scim2-models-exceptions
branch
from
September 20, 2026 11:21
fff8fad to
7e57689
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #39