pub enum AkahuError {
Show 13 variants
BadRequest {
message: String,
status: u16,
},
Unauthorized {
message: String,
},
Forbidden {
message: String,
},
NotFound {
message: String,
},
RateLimited {
message: String,
},
InternalServerError {
message: String,
},
ApiError {
status: u16,
message: String,
},
Network(Error),
InvalidHeaderValue(InvalidHeaderValue),
UrlParse(ParseError),
JsonDeserialization {
error: Error,
source_string: Option<String>,
},
MissingAppSecret,
OAuth {
error: String,
error_description: Option<String>,
},
}Expand description
Common Akahu error types as per the documentation.
[https://developers.akahu.nz/docs/response-formatting#common-error-messages]
Variants§
BadRequest
Bad request - invalid request parameters
Unauthorized - invalid or revoked authentication credentials
Fields
Error message from the API
Forbidden
Forbidden - insufficient permissions or missing required headers
NotFound
Not found - resource doesn’t exist or is inaccessible
RateLimited
Rate limited - too many requests
InternalServerError
Internal server error - system-level failure
ApiError
Generic API error with status code and message
Network(Error)
Network error from reqwest
InvalidHeaderValue(InvalidHeaderValue)
Invalid header value
UrlParse(ParseError)
URL parse error
JsonDeserialization
JSON deserialization error
Fields
MissingAppSecret
Missing app secret - call with_app_secret() first for app-scoped endpoints
OAuth
OAuth error response (follows OAuth2 spec)
Trait Implementations§
Source§impl Debug for AkahuError
impl Debug for AkahuError
Source§impl Display for AkahuError
impl Display for AkahuError
Source§impl Error for AkahuError
impl Error for AkahuError
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<Error> for AkahuError
impl From<Error> for AkahuError
Source§impl From<InvalidHeaderValue> for AkahuError
impl From<InvalidHeaderValue> for AkahuError
Source§fn from(source: InvalidHeaderValue) -> Self
fn from(source: InvalidHeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for AkahuError
impl From<ParseError> for AkahuError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AkahuError
impl !RefUnwindSafe for AkahuError
impl Send for AkahuError
impl Sync for AkahuError
impl Unpin for AkahuError
impl !UnwindSafe for AkahuError
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> 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.