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.
Example code if this is implemented
@app.exception_handler(SCIMResponseErrorObject)
async def scim_response_error_object_handler(_request: Request, exc: SCIMResponseErrorObject):
return JSONResponse(
status_code=exc.error.status,
content=exc.error.model_dump(),
)
Currently
SCIMResponseErrorObjectjust reads theErrorobject 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 theErrorthere.For example, in FastAPI we could override the exception with
@app.exception_handler(SCIMResponseErrorObject)and return json according to the rfc.Example code if this is implemented