pub enum TodoistError {
RateLimited {
retry_after: Option<u64>,
message: String,
},
AuthenticationError {
message: String,
},
AuthorizationError {
message: String,
},
NotFound {
resource_type: String,
resource_id: Option<String>,
message: String,
},
ValidationError {
field: Option<String>,
message: String,
},
ServerError {
status_code: u16,
message: String,
},
NetworkError {
message: String,
},
ParseError {
message: String,
},
EmptyResponse {
endpoint: String,
message: String,
},
Generic {
status_code: Option<u16>,
message: String,
},
}
Expand description
Represents different types of errors that can occur when interacting with the Todoist API
Variants§
RateLimited
Rate limiting error (HTTP 429)
AuthenticationError
Authentication error (HTTP 401)
AuthorizationError
Authorization error (HTTP 403)
NotFound
Resource not found (HTTP 404)
ValidationError
Validation error (HTTP 400)
ServerError
Server error (HTTP 5xx)
NetworkError
Network/connection error
ParseError
JSON parsing error
EmptyResponse
Unexpected empty response (when API returns nothing)
Generic
Generic error for other cases
Implementations§
Source§impl TodoistError
impl TodoistError
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Check if this is a rate limiting error
Sourcepub fn is_authentication_error(&self) -> bool
pub fn is_authentication_error(&self) -> bool
Check if this is an authentication error
Check if this is an authorization error
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this is a not found error
Sourcepub fn is_validation_error(&self) -> bool
pub fn is_validation_error(&self) -> bool
Check if this is a validation error
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if this is a server error
Sourcepub fn is_network_error(&self) -> bool
pub fn is_network_error(&self) -> bool
Check if this is a network error
Sourcepub fn is_empty_response(&self) -> bool
pub fn is_empty_response(&self) -> bool
Check if this is an empty response error
Sourcepub fn retry_after(&self) -> Option<u64>
pub fn retry_after(&self) -> Option<u64>
Get the retry after value for rate limiting errors
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Get the HTTP status code if available
Trait Implementations§
Source§impl Clone for TodoistError
impl Clone for TodoistError
Source§fn clone(&self) -> TodoistError
fn clone(&self) -> TodoistError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more