Skip to main content

authn_resolver_sdk/
error.rs

1//! Error types for the `AuthN` resolver module.
2
3use thiserror::Error;
4
5/// Errors that can occur when using the `AuthN` resolver API.
6#[derive(Debug, Error)]
7pub enum AuthNResolverError {
8    /// The token is invalid, expired, or malformed.
9    #[error("unauthorized: {0}")]
10    Unauthorized(String),
11
12    /// No `AuthN` plugin is available to handle the request.
13    #[error("no plugin available")]
14    NoPluginAvailable,
15
16    /// The plugin is not available yet.
17    #[error("service unavailable: {0}")]
18    ServiceUnavailable(String),
19
20    /// An internal error occurred.
21    #[error("internal error: {0}")]
22    Internal(String),
23}