pub enum Error {
Show 19 variants
Http(String),
Network(String),
Timeout,
Unauthorized(String),
Forbidden(String),
Api {
status: u16,
message: String,
},
NotFound(String),
RateLimited {
retry_after: Option<u64>,
},
ServerError {
status: u16,
message: String,
},
Serialization(Error),
InvalidData(String),
Config(String),
MissingConfig(String),
Storage(String),
CredentialNotFound {
provider: String,
key: String,
},
ProviderNotFound(String),
ProviderUnsupported {
provider: String,
operation: String,
},
Io(Error),
Other(Error),
}Expand description
Main error type for devboy operations.
Variants§
Http(String)
HTTP request failed
Network(String)
Network connectivity error
Timeout
401 Unauthorized - invalid or missing credentials
Forbidden(String)
403 Forbidden - valid credentials but insufficient permissions
Api
API returned an error response
NotFound(String)
Resource not found (404)
RateLimited
Rate limit exceeded (429)
ServerError
Server error (5xx)
Serialization(Error)
Serialization/deserialization failed
InvalidData(String)
Invalid data format or content
Config(String)
Configuration error
MissingConfig(String)
Missing required configuration
Storage(String)
Storage/keychain error
CredentialNotFound
Credential not found in keychain
ProviderNotFound(String)
Provider not found or not configured
ProviderUnsupported
Provider not supported for this operation
Io(Error)
IO error
Other(Error)
Generic error wrapper
Implementations§
Source§impl Error
impl Error
Sourcepub fn from_status(status: u16, message: impl Into<String>) -> Self
pub fn from_status(status: u16, message: impl Into<String>) -> Self
Create an API error from HTTP status and message.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this is a retryable error.
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if this is an authentication error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.