#[non_exhaustive]pub enum RuntimeError {
Config(ConfigError),
Auth(AuthError),
Webhook(WebhookError),
File(FileError),
Notification(NotificationError),
Observer(ObserverError),
Integration(IntegrationError),
Database(Error),
RateLimited {
retry_after: Option<u64>,
},
ServiceUnavailable {
reason: String,
retry_after: Option<u64>,
},
NotFound {
resource: String,
},
Internal {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
}Expand description
Unified error type wrapping all domain errors.
RuntimeError aggregates every domain-level error that can surface during
request handling. It implements [axum::response::IntoResponse] so that
handlers can return Result<_, RuntimeError> directly; the conversion
produces an [ErrorResponse] JSON body with the appropriate HTTP status
code. Sensitive internal details (database messages, config values) are
stripped from the HTTP response and are only present in server-side logs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Config(ConfigError)
A configuration error, such as an invalid or missing config file.
Auth(AuthError)
An authentication or authorisation error (invalid token, expired session, etc.).
Webhook(WebhookError)
A webhook validation error (bad signature, duplicate event, expired timestamp, etc.).
File(FileError)
A file-handling error (size limit exceeded, unsupported type, virus detected, etc.).
Notification(NotificationError)
A notification delivery error (provider unavailable, circuit open, rate-limited, etc.).
Observer(ObserverError)
An observer/event processing error (invalid condition, action failure, etc.).
Integration(IntegrationError)
An external integration error (search, cache, queue, or connection failure).
Database(Error)
A database-level error propagated from sqlx.
The raw sqlx message is available for logging but is never exposed in HTTP responses (returns a generic “database error” description instead).
RateLimited
The caller has exceeded the configured request rate limit.
retry_after is the number of seconds to wait before retrying, if known.
A downstream service or dependency is temporarily unavailable.
retry_after is the number of seconds to wait before retrying, if known.
NotFound
The requested resource does not exist.
Internal
An unexpected internal server error.
Use this variant when no more specific variant applies. The message
is recorded in server logs but is never forwarded to clients.
Implementations§
Source§impl RuntimeError
impl RuntimeError
Trait Implementations§
Source§impl Debug for RuntimeError
impl Debug for RuntimeError
Source§impl Display for RuntimeError
impl Display for RuntimeError
Source§impl Error for RuntimeError
impl Error for RuntimeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AuthError> for RuntimeError
impl From<AuthError> for RuntimeError
Source§impl From<ConfigError> for RuntimeError
impl From<ConfigError> for RuntimeError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Source§impl From<Error> for RuntimeError
impl From<Error> for RuntimeError
Source§impl From<FileError> for RuntimeError
impl From<FileError> for RuntimeError
Source§impl From<IntegrationError> for RuntimeError
impl From<IntegrationError> for RuntimeError
Source§fn from(source: IntegrationError) -> Self
fn from(source: IntegrationError) -> Self
Source§impl From<NotificationError> for RuntimeError
impl From<NotificationError> for RuntimeError
Source§fn from(source: NotificationError) -> Self
fn from(source: NotificationError) -> Self
Source§impl From<ObserverError> for RuntimeError
impl From<ObserverError> for RuntimeError
Source§fn from(source: ObserverError) -> Self
fn from(source: ObserverError) -> Self
Source§impl From<WebhookError> for RuntimeError
impl From<WebhookError> for RuntimeError
Source§fn from(source: WebhookError) -> Self
fn from(source: WebhookError) -> Self
Auto Trait Implementations§
impl Freeze for RuntimeError
impl !RefUnwindSafe for RuntimeError
impl Send for RuntimeError
impl Sync for RuntimeError
impl Unpin for RuntimeError
impl UnsafeUnpin for RuntimeError
impl !UnwindSafe for RuntimeError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more