pub enum Error {
Validation(String),
Http(Error),
Status {
method: &'static str,
status: u16,
},
CreateTask {
code: String,
description: String,
},
GetResult {
code: String,
description: String,
},
GetBalance {
code: String,
description: String,
},
MalformedResponse(String),
Timeout(Duration),
UnsupportedProxyType(String),
Json(Error),
}Expand description
Everything that can go wrong while talking to CapMonster Cloud.
Variants§
Validation(String)
The request object is inconsistent (missing/forbidden field, value out of range…). Raised locally, before anything is sent to the network.
Http(Error)
Network / TLS / timeout error from the HTTP layer.
Status
The server answered with an unexpected HTTP status code.
CreateTask
createTask returned errorId != 0.
GetResult
getTaskResult returned errorId != 0.
GetBalance
getBalance returned errorId != 0.
MalformedResponse(String)
The server’s JSON was missing a field we need (e.g. taskId).
Timeout(Duration)
The solution did not arrive within the maximum waiting interval of this task type.
UnsupportedProxyType(String)
The proxy type given in ClientOptions::client_proxy is not supported (only http/https).
Json(Error)
(De)serialization failure.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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