ScimError

Enum ScimError 

Source
pub enum ScimError {
    Validation(ValidationError),
    Provider(Box<dyn Error + Send + Sync>),
    Json(Error),
    ResourceNotFound {
        resource_type: String,
        id: String,
    },
    SchemaNotFound {
        schema_id: String,
    },
    Internal {
        message: String,
    },
    InvalidRequest {
        message: String,
    },
    UnsupportedResourceType(String),
    UnsupportedOperation {
        resource_type: String,
        operation: String,
    },
    MethodNotFound(String),
    MapperNotFound(usize),
    ProviderError(String),
}
Expand description

Main error type for SCIM server operations.

This enum covers all possible error conditions that can occur during SCIM server operations, providing detailed context for each error type.

Variants§

§

Validation(ValidationError)

Validation errors when resource data doesn’t conform to schema

§

Provider(Box<dyn Error + Send + Sync>)

Errors from the user-provided resource provider

§

Json(Error)

JSON serialization/deserialization errors

§

ResourceNotFound

Resource not found errors

Fields

§resource_type: String

The type of resource that was not found

§id: String

The ID of the resource that was not found

§

SchemaNotFound

Schema not found errors

Fields

§schema_id: String

The ID of the schema that was not found

§

Internal

Internal server errors

Fields

§message: String

Description of the internal error

§

InvalidRequest

Invalid request format or parameters

Fields

§message: String

Description of what makes the request invalid

§

UnsupportedResourceType(String)

Unsupported resource type

§

UnsupportedOperation

Unsupported operation for resource type

Fields

§resource_type: String

The resource type for which the operation is unsupported

§operation: String

The operation that is not supported

§

MethodNotFound(String)

Method not found on resource

§

MapperNotFound(usize)

Schema mapper not found

§

ProviderError(String)

Resource provider error with string message

Implementations§

Source§

impl ScimError

Source

pub fn resource_not_found( resource_type: impl Into<String>, id: impl Into<String>, ) -> Self

Create a resource not found error

Source

pub fn schema_not_found(schema_id: impl Into<String>) -> Self

Create a schema not found error

Source

pub fn internal(message: impl Into<String>) -> Self

Create an internal server error

Source

pub fn invalid_request(message: impl Into<String>) -> Self

Create an invalid request error

Source

pub fn provider_error<E>(error: E) -> Self
where E: Error + Send + Sync + 'static,

Wrap a provider error

Trait Implementations§

Source§

impl Debug for ScimError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ScimError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ScimError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for ScimError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for ScimError

Source§

fn from(source: ValidationError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TenantValidator for T

Source§

fn validate_tenant_context( &self, expected_tenant_id: &str, context: &RequestContext, ) -> Result<(), String>

Validate that the context has the expected tenant.
Source§

fn validate_single_tenant_context( &self, context: &RequestContext, ) -> Result<(), String>

Validate that the context is for single-tenant operation.
Source§

fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>

Extract tenant context or return error for multi-tenant operations.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.