#[derive(Debug, thiserror::Error)]
pub enum StackureError {
#[error("stackure: validation: {0}")]
Validation(String),
#[error("stackure: network: {0}")]
Network(String),
#[error("stackure: auth: {0}")]
Auth(String),
#[error("stackure: timeout: {0}")]
Timeout(String),
#[error("stackure: forbidden: {0}")]
Forbidden(String),
}
impl StackureError {
#[must_use]
pub fn code(&self) -> &'static str {
match self {
Self::Validation(_) => "validation",
Self::Network(_) => "network",
Self::Auth(_) => "auth",
Self::Timeout(_) => "timeout",
Self::Forbidden(_) => "forbidden",
}
}
}