You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include Error object in SCIMResponseErrorObject #37
Currently SCIMResponseErrorObject just reads the Error object and prints information to the message. However, it would be beneficial to also store the object into the exception in case we want to handle the error somewhere else and access the Error there.
For example, in FastAPI we could override the exception with @app.exception_handler(SCIMResponseErrorObject) and return json according to the rfc.
It would definitively be feasible to provide the Error object in the exceptions.
However, after the exceptions overhaul in scim2-models, I am tempted to re-use the exceptions it provides directly, this would allow to use except SCIMException or filter more precisely, such as except UniquenessException. However that would mean abandoning or reworking the SCIMResponseErrorObject and SCIMRequestErrorObject distinction. 🤔
The error object could be accessed by exc.to_error().
Yeah, honestly the most important thing is that we can create or access the corresponding Error object from exceptions and vice versa. So it would be totally fine if the client raises SCIMException instead of SCIMResponseErrorObject
I will probably do it in a cleaner way later, in the meantime there is a .to_error() method in the scim2-client exceptions (that matches the scim2-models method). This is released in 0.7.3
Activity
azmeuk commentedon Feb 4, 2026
Thank you for the bug report.
It would definitively be feasible to provide the
Errorobject in the exceptions.However, after the exceptions overhaul in scim2-models, I am tempted to re-use the exceptions it provides directly, this would allow to use
except SCIMExceptionor filter more precisely, such asexcept UniquenessException. However that would mean abandoning or reworking theSCIMResponseErrorObjectandSCIMRequestErrorObjectdistinction. 🤔The error object could be accessed by
exc.to_error().NaqGuug commentedon Feb 4, 2026
Yeah, honestly the most important thing is that we can create or access the corresponding
Errorobject from exceptions and vice versa. So it would be totally fine if the client raisesSCIMExceptioninstead ofSCIMResponseErrorObjectazmeuk commentedon Feb 4, 2026
I will probably do it in a cleaner way later, in the meantime there is a
.to_error()method in the scim2-client exceptions (that matches the scim2-models method). This is released in 0.7.3