pub enum RequestError {
BadRequest(String),
Unauthorized,
Forbidden,
NotFound,
ParseError(String),
Unreachable,
TooManyRequests,
Unhandled,
}Expand description
Represents errors when interacting with the PocketBase API.
This enum provides a set of error types that may occur during API requests, each indicating a specific issue encountered.
Variants§
BadRequest(String)
Communication with the PocketBase API was successful,
but returned a 400 Bad Request HTTP error response.
Your request may be missing fields or its content doesn’t match what PocketBase expects to receive.
Communication with the PocketBase API was successful,
but returned a 401 Unauthorized HTTP error response.
The request may require an Authorization Token.
Forbidden
Communication with the PocketBase API was successful,
but returned a 403 Forbidden HTTP error response.
The authenticated user may not have permissions for this interaction.
NotFound
Communication with the PocketBase API was successful,
but returned a 404 Not Found HTTP error response.
ParseError(String)
The response could not be parsed into the expected data structure.
Unreachable
The PocketBase API interaction timed out. It may be offline.
TooManyRequests
Too many requests were sent to the API.
The server is rate limiting requests. Wait before retrying.
Unhandled
Unhandled error.
Usually emitted when something unexpected happened, and isn’t handled correctly by this crate.
Trait Implementations§
Source§impl Debug for RequestError
impl Debug for RequestError
Source§impl Display for RequestError
impl Display for RequestError
Source§impl Error for RequestError
impl Error for RequestError
1.30.0 · 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
Auto Trait Implementations§
impl Freeze for RequestError
impl RefUnwindSafe for RequestError
impl Send for RequestError
impl Sync for RequestError
impl Unpin for RequestError
impl UnwindSafe for RequestError
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.