#[non_exhaustive]pub enum Error {
InvalidTypeName {
name: String,
},
UnexpectedItem {
expected: MessageType,
got: MessageType,
},
UnsendableFilterValue {
filter: String,
value: String,
},
Config {
msg: String,
},
ReqWest {
reqwest: Error,
},
ValidationFailure {
failures: Failures,
},
RateLimited {
attempts: u32,
limit: RateLimit,
},
ResourceNotFound {
resource: Box<ResourceComponent>,
},
Serde {
error: Error,
},
}Expand description
All different error types this crate uses.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidTypeName
if an invalid type was requested
UnexpectedItem
if there is a mismatch between the expected return type of the crossref api and this rust client
Fields
expected: MessageTypethe message type this client expected
got: MessageTypethe message type crossref actually returned
UnsendableFilterValue
a filter value crossref has no way to read back
Crossref splits the filter value on , after percent-decoding it, so
a value carrying one arrives as two filters – container-title:A, B
becomes container-title:A plus a filter called B. There is no form
that survives the split, so the request is refused rather than sent to
be rejected with a 400.
Fields
Config
a config error
ReqWest
an error that occurred while operating with reqwest
ValidationFailure
crossref refused the request and said why
Answered with a 400 and a validation-failure body, which is what an
unknown filter, sort field or field query produces.
RateLimited
crossref kept answering 429 until the retry budget ran out
The client paces itself against the limit crossref reports, so this
normally means requests are also being made outside it – from another
process, or another Crossref built separately
rather than cloned.
Fields
ResourceNotFound
When crossref could not find anything
Fields
resource: Box<ResourceComponent>the resource that could not be resolved
Serde
if a error in serde occurred
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()