pub enum FetchError {
MissingUrl,
InvalidUrlScheme,
InvalidMethod,
BlockedUrl,
ClientBuildError(Error),
FirstByteTimeout,
ConnectError(Error),
RequestError(String),
FetcherError(String),
SaveError(String),
SaverNotAvailable,
RenderNotAvailable,
}Expand description
Errors that can occur during fetch operations
§Examples
use fetchkit::FetchError;
let err = FetchError::MissingUrl;
assert_eq!(err.to_string(), "Missing required parameter: url");Variants§
MissingUrl
URL is missing
InvalidUrlScheme
URL has invalid scheme
InvalidMethod
Invalid HTTP method
BlockedUrl
URL is blocked by policy (prefix list or DNS policy)
ClientBuildError(Error)
Failed to build HTTP client
FirstByteTimeout
Request timed out waiting for first byte
ConnectError(Error)
Failed to connect to server
RequestError(String)
Other request error
FetcherError(String)
Fetcher-specific error
SaveError(String)
File save failed
SaverNotAvailable
No FileSaver provided but save_to_file was requested
RenderNotAvailable
Rendered fetch requested but not enabled or not compiled in
Implementations§
Source§impl FetchError
impl FetchError
Sourcepub fn from_reqwest(err: Error) -> Self
pub fn from_reqwest(err: Error) -> Self
Create an error from a reqwest error
Trait Implementations§
Source§impl Debug for FetchError
impl Debug for FetchError
Source§impl Display for FetchError
impl Display for FetchError
Source§impl Error for FetchError
impl Error for FetchError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<TransportError> for FetchError
impl From<TransportError> for FetchError
Source§fn from(err: TransportError) -> Self
fn from(err: TransportError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for FetchError
impl !UnwindSafe for FetchError
impl Freeze for FetchError
impl Send for FetchError
impl Sync for FetchError
impl Unpin for FetchError
impl UnsafeUnpin for FetchError
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more