pub enum ResoError {
Config(String),
Network(String),
Unauthorized {
message: String,
status_code: u16,
},
Forbidden {
message: String,
status_code: u16,
},
NotFound {
message: String,
status_code: u16,
},
RateLimited {
message: String,
status_code: u16,
},
ServerError {
message: String,
status_code: u16,
},
ODataError {
message: String,
status_code: u16,
},
Parse(String),
InvalidQuery(String),
}Expand description
RESO client errors
All errors that can occur when using the RESO client library. Each variant includes contextual information to help diagnose issues.
§Examples
let result = ResoClient::from_env();
match result {
Err(ResoError::Config(msg)) => {
eprintln!("Configuration error: {}", msg);
eprintln!("Make sure RESO_BASE_URL and RESO_TOKEN are set");
}
Ok(client) => {
println!("Client created successfully");
}
_ => {}
}Variants§
Config(String)
Configuration error
Network(String)
Network/HTTP error
401 Unauthorized - Invalid or missing authentication token
Fields
Forbidden
403 Forbidden - Valid credentials but insufficient permissions
NotFound
404 Not Found - Resource or endpoint not found
RateLimited
429 Too Many Requests - Rate limit exceeded
ServerError
5xx Server Error - Server-side error
ODataError
Generic OData server error for other status codes
Parse(String)
Parsing error
InvalidQuery(String)
Invalid query
Trait Implementations§
Source§impl Error for ResoError
impl Error for ResoError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for ResoError
impl RefUnwindSafe for ResoError
impl Send for ResoError
impl Sync for ResoError
impl Unpin for ResoError
impl UnwindSafe for ResoError
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.