Skip to main content

aura_authorization/
errors.rs

1//! Web of Trust error handling using unified error macros.
2//!
3//! **DESIGN**: Uses aura-macros error generator for consistent error shape and categories.
4
5use aura_macros::aura_error_types;
6
7aura_error_types! {
8    #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
9    pub enum WotError {
10        #[category = "authorization"]
11        InvalidToken { details: String } =>
12            "Invalid authorization token: {details}",
13
14        #[category = "authorization"]
15        InvalidCapabilities { details: String } =>
16            "Invalid capabilities: {details}",
17
18        #[category = "authorization"]
19        PermissionDenied { details: String } =>
20            "Permission denied: {details}",
21
22        #[category = "system"]
23        SystemError { details: String } =>
24            "System error: {details}",
25    }
26}
27
28/// WoT result type alias using macro-generated error
29pub type WotResult<T> = Result<T, WotError>;