pub enum FigshareError {
Show 14 variants
Http {
status: StatusCode,
message: Option<String>,
code: Option<String>,
field_errors: Vec<FieldError>,
raw_body: Option<String>,
},
Transport(Error),
Json(Error),
Io(Error),
Url(ParseError),
EnvVar {
name: String,
source: VarError,
},
MissingAuth(&'static str),
InvalidState(String),
MissingLink(&'static str),
MissingFile {
name: String,
},
DuplicateUploadFilename {
filename: String,
},
ConflictingDraftFile {
filename: String,
},
UnsupportedSelector(String),
Timeout(&'static str),
}Expand description
Errors produced by the Figshare client.
Variants§
Http
Figshare returned a non-success HTTP status.
Fields
status: StatusCodeHTTP status returned by Figshare.
field_errors: Vec<FieldError>Field-level validation errors extracted from the response body.
Transport(Error)
A transport error occurred while sending or receiving a request.
Json(Error)
JSON serialization or deserialization failed.
Io(Error)
A local I/O operation failed.
Url(ParseError)
A URL could not be parsed or joined.
Tuple Fields
0: ParseErrorUnderlying URL parse error.
EnvVar
A required environment variable could not be read.
MissingAuth(&'static str)
Authentication was required for a private operation.
InvalidState(String)
Figshare returned data that violates a workflow invariant.
MissingLink(&'static str)
A required link relation was missing from a Figshare payload.
MissingFile
A requested file name was not present on an article.
DuplicateUploadFilename
Multiple uploads targeted the same final filename.
ConflictingDraftFile
A keep-existing upload would overwrite an existing draft file.
UnsupportedSelector(String)
A selector could not be resolved to an article.
Timeout(&'static str)
Polling timed out before Figshare reached the requested state.
Trait Implementations§
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
use the Display impl or to_string()
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Source§fn from(error: UploadNameValidationError) -> Self
fn from(error: UploadNameValidationError) -> Self
Auto Trait Implementations§
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.