pub enum TurboCdnError {
Show 19 variants
Network(Error),
Io(Error),
InvalidUrl(ParseError),
Json(Error),
Config {
message: String,
},
Download {
message: String,
},
SourceValidation {
message: String,
},
Compliance {
message: String,
},
Cache {
message: String,
},
Routing {
message: String,
},
Authentication {
message: String,
},
RateLimit {
message: String,
},
Timeout {
message: String,
},
ChecksumMismatch {
expected: String,
actual: String,
},
FileNotFound {
path: String,
},
HttpStatus {
status_code: u16,
message: String,
url: String,
},
ServerError {
status_code: u16,
message: String,
url: String,
},
Unsupported {
message: String,
},
Internal {
message: String,
},
}Expand description
Main error type for turbo-cdn operations
Variants§
Network(Error)
Network-related errors
Io(Error)
IO-related errors
InvalidUrl(ParseError)
URL parsing errors
Json(Error)
JSON parsing errors
Config
Configuration errors
Download
Download errors
SourceValidation
Source validation errors
Compliance
Compliance errors
Cache
Cache errors
Routing
Routing errors
Authentication
Authentication errors
RateLimit
Rate limiting errors
Timeout
Timeout errors
ChecksumMismatch
Checksum validation errors
FileNotFound
File not found errors
HttpStatus
HTTP status code errors (non-retryable client errors like 404)
ServerError
Server errors (5xx, potentially retryable)
Unsupported
Unsupported operation errors
Internal
Generic errors
Implementations§
Source§impl TurboCdnError
impl TurboCdnError
Sourcepub fn source_validation<S: Into<String>>(message: S) -> Self
pub fn source_validation<S: Into<String>>(message: S) -> Self
Create a new source validation error
Sourcepub fn compliance<S: Into<String>>(message: S) -> Self
pub fn compliance<S: Into<String>>(message: S) -> Self
Create a new compliance error
Sourcepub fn authentication<S: Into<String>>(message: S) -> Self
pub fn authentication<S: Into<String>>(message: S) -> Self
Create a new authentication error
Sourcepub fn rate_limit<S: Into<String>>(message: S) -> Self
pub fn rate_limit<S: Into<String>>(message: S) -> Self
Create a new rate limit error
Sourcepub fn checksum_mismatch<S: Into<String>>(expected: S, actual: S) -> Self
pub fn checksum_mismatch<S: Into<String>>(expected: S, actual: S) -> Self
Create a new checksum mismatch error
Sourcepub fn file_not_found<S: Into<String>>(path: S) -> Self
pub fn file_not_found<S: Into<String>>(path: S) -> Self
Create a new file not found error
Sourcepub fn http_status<S: Into<String>>(
status_code: u16,
message: S,
url: S,
) -> Self
pub fn http_status<S: Into<String>>( status_code: u16, message: S, url: S, ) -> Self
Create a new HTTP status error (for 4xx client errors)
Sourcepub fn server_error<S: Into<String>>(
status_code: u16,
message: S,
url: S,
) -> Self
pub fn server_error<S: Into<String>>( status_code: u16, message: S, url: S, ) -> Self
Create a new server error (for 5xx errors)
Sourcepub fn from_status_code<S: Into<String>>(status_code: u16, url: S) -> Self
pub fn from_status_code<S: Into<String>>(status_code: u16, url: S) -> Self
Create an error from HTTP status code
Sourcepub fn unsupported<S: Into<String>>(message: S) -> Self
pub fn unsupported<S: Into<String>>(message: S) -> Self
Create a new unsupported operation error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if the error is retryable
Sourcepub fn should_try_next_mirror(&self) -> bool
pub fn should_try_next_mirror(&self) -> bool
Check if this error indicates the resource doesn’t exist on this server and we should immediately try the next mirror
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Get HTTP status code if this is an HTTP error
Trait Implementations§
Source§impl Debug for TurboCdnError
impl Debug for TurboCdnError
Source§impl Display for TurboCdnError
impl Display for TurboCdnError
Source§impl Error for TurboCdnError
impl Error for TurboCdnError
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
Source§impl From<Error> for TurboCdnError
impl From<Error> for TurboCdnError
Source§impl From<Error> for TurboCdnError
impl From<Error> for TurboCdnError
Source§impl From<Error> for TurboCdnError
impl From<Error> for TurboCdnError
Source§impl From<ParseError> for TurboCdnError
impl From<ParseError> for TurboCdnError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for TurboCdnError
impl !RefUnwindSafe for TurboCdnError
impl Send for TurboCdnError
impl Sync for TurboCdnError
impl Unpin for TurboCdnError
impl UnsafeUnpin for TurboCdnError
impl !UnwindSafe for TurboCdnError
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> Pointable for T
impl<T> Pointable for T
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.