Enum egg_mode::error::Error [−][src]
pub enum Error {}Show variants
BadUrl, InvalidResponse(&'static str, Option<String>), MissingValue(&'static str), FutureAlreadyCompleted, TwitterError(Headers, TwitterErrors), RateLimit(i32), MediaError(MediaError), BadStatus(StatusCode), NetError(Error), TlsError(Error), IOError(Error), DeserializeError(Error), TimestampParseError(ParseError), TimerShutdownError(Error), HeaderParseError(ToStrError), HeaderConvertError(ParseIntError),
Expand description
A set of errors that can occur when interacting with Twitter.
Variants
A URL was passed to a shortcut function that didn’t match the method being called.
The response from Twitter was formatted incorrectly or in an unexpected manner. The enclosed values are an explanatory string and, if applicable, the input that caused the error.
This usually reflects a bug in this library, as it means I’m not parsing input right.
MissingValue(&'static str)
The response from Twitter was missing an expected value. The enclosed value was the expected parameter.
This usually reflects a bug in this library, as it means I’m expecting a value that may not always be there, and need to update my parsing to reflect this.
The Future
being polled has already returned a completed value (or another error). In
order to retry the request, create the Future
again.
TwitterError(Headers, TwitterErrors)
The response from Twitter returned an error structure instead of the expected response. The enclosed value was the response from Twitter.
RateLimit(i32)
The response returned from Twitter contained an error indicating that the rate limit for that method has been reached. The enclosed value is the Unix timestamp in UTC when the next rate-limit window will open.
MediaError(MediaError)
An attempt to upload a video or gif successfully uploaded the file, but failed in post-processing. The enclosed value contains the error message from Twitter.
BadStatus(StatusCode)
The response from Twitter gave a response code that indicated an error. The enclosed value was the response code.
This is only returned if Twitter did not also return an error code in the response body. That check is performed before examining the status code.
NetError(Error)
The web request experienced an error. The enclosed error was returned from hyper.
TlsError(Error)
The native_tls
implementation returned an error. The enclosed error was returned from
native_tls
.
IOError(Error)
An error was experienced while processing the response stream. The enclosed error was returned from libstd.
DeserializeError(Error)
An error occurred while loading the JSON response. The enclosed error was returned from
serde_json
.
TimestampParseError(ParseError)
An error occurred when parsing a timestamp from Twitter. The enclosed error was returned from chrono.
TimerShutdownError(Error)
The tokio Timer
instance was shut down while waiting on a timer, for example while waiting
for media to be processed by Twitter. The enclosed error was returned from tokio
.
HeaderParseError(ToStrError)
An error occurred when reading the value from a response header. The enclused error was returned from hyper.
This error should be considerably rare, but is included to ensure that egg-mode doesn’t panic if it receives malformed headers or the like.
HeaderConvertError(ParseIntError)
An error occurred when converting a rate-limit header to an integer. The enclosed error was returned from the standard library.
This error should be considerably rare, but is included to ensure that egg-mode doesn’t panic if it receives malformed headers or the like.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error