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
SchemaNotFound
Schema not found errors
Internal
Internal server errors
InvalidRequest
Invalid request format or parameters
UnsupportedResourceType(String)
Unsupported resource type
UnsupportedOperation
Unsupported operation for resource type
Fields
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
impl ScimError
Sourcepub fn resource_not_found(
resource_type: impl Into<String>,
id: impl Into<String>,
) -> Self
pub fn resource_not_found( resource_type: impl Into<String>, id: impl Into<String>, ) -> Self
Create a resource not found error
Sourcepub fn schema_not_found(schema_id: impl Into<String>) -> Self
pub fn schema_not_found(schema_id: impl Into<String>) -> Self
Create a schema not found error
Sourcepub fn invalid_request(message: impl Into<String>) -> Self
pub fn invalid_request(message: impl Into<String>) -> Self
Create an invalid request error
Sourcepub fn provider_error<E>(error: E) -> Self
pub fn provider_error<E>(error: E) -> Self
Wrap a provider error
Trait Implementations§
Source§impl Error for ScimError
impl Error for ScimError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ValidationError> for ScimError
impl From<ValidationError> for ScimError
Source§fn from(source: ValidationError) -> Self
fn from(source: ValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ScimError
impl !RefUnwindSafe for ScimError
impl Send for ScimError
impl Sync for ScimError
impl Unpin for ScimError
impl !UnwindSafe for ScimError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> TenantValidator for T
impl<T> TenantValidator for T
Source§fn validate_tenant_context(
&self,
expected_tenant_id: &str,
context: &RequestContext,
) -> Result<(), String>
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>
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>
fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
Extract tenant context or return error for multi-tenant operations.