pub enum RestError {
RestApiDisabled,
InvalidPath {
path: String,
},
Http(HttpError),
}Expand description
Error type for REST API operations.
This enum provides specific error types for REST API operations, wrapping HTTP errors and adding REST-specific error cases.
§Example
use shopify_sdk::clients::rest::RestError;
// REST API disabled error
let error = RestError::RestApiDisabled;
assert!(error.to_string().contains("deprecated"));
// Invalid path error
let error = RestError::InvalidPath { path: "".to_string() };
assert!(error.to_string().contains("Invalid"));Variants§
RestApiDisabled
The REST Admin API has been deprecated and is disabled.
This error is returned when the REST API is disabled in the SDK configuration, indicating that users should migrate to GraphQL.
InvalidPath
The REST API path is invalid.
This error is returned when a path fails validation, such as when it is empty after normalization.
Http(HttpError)
An HTTP-level error occurred.
This variant wraps HttpError for unified error handling.
Trait Implementations§
Source§impl Error for RestError
impl Error for RestError
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 RestError
impl !RefUnwindSafe for RestError
impl Send for RestError
impl Sync for RestError
impl Unpin for RestError
impl !UnwindSafe for RestError
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