Errors#

Exceptions raised when an exchange with a server cannot be completed. An Error the server itself returned is raised as the matching SCIMException subclass instead.

class scim2_client.SCIMClientException(message: str, source: Any = None, *args: Any, response: RawResponse | None = None, **kwargs: Any)[source]#

Base exception for scim2-client.

Parameters:
  • message – The exception reason.

  • source – The request payload that caused the exception.

  • response – The response that caused the exception.

class scim2_client.RequestNetworkException(*args: Any, **kwargs: Any)[source]#

Exception raised when a network error happened during request.

This exception is raised when a httpx2.RequestError has been caught while performing a request. The original RequestError is available with __cause__.

class scim2_client.SCIMResponseException(message: str, source: Any = None, *args: Any, response: RawResponse | None = None, **kwargs: Any)[source]#

Base exception for errors happening during response payload validation.

class scim2_client.UnexpectedStatusCodeException(status_code: int, *args: Any, **kwargs: Any)[source]#

Exception raised when a server returned an unexpected status code.

The status code is available with the status_code attribute.

class scim2_client.UnexpectedContentTypeException(content_type: str, *args: Any, **kwargs: Any)[source]#

Exception raised when a server returned an unexpected Content-Type header.

The content type is available with the content_type attribute.

class scim2_client.UnexpectedContentFormatException(*args: Any, **kwargs: Any)[source]#

Exception raised when a server returned a response in a non-JSON format.

class scim2_client.ResponsePayloadValidationException(*args: Any, **kwargs: Any)[source]#

Exception raised when the server returned a payload that cannot be validated.

This exception is raised when a ValidationError has been caught while validating the server response payload. The original ValidationError is available with __cause__.

try:
    scim.query(User, "foobar")
except ResponsePayloadValidationException as exc:
    print("Original validation error cause", exc.__cause__)
class scim2_client.InvalidServiceDescriptionException(*args: Any, **kwargs: Any)[source]#

Exception raised when a server describes a service that cannot be composed.

This exception is raised when a ScimProviderError has been caught while building the ScimProvider describing the server. The original ScimProviderError is available with __cause__.