Enum egg_mode::error::Error[][src]

pub enum Error {
Show variants BadUrl, InvalidResponse(&'static strOption<String>), MissingValue(&'static str), FutureAlreadyCompleted, TwitterError(HeadersTwitterErrors), 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

BadUrl

A URL was passed to a shortcut function that didn’t match the method being called.

InvalidResponse(&'static strOption<String>)

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.

FutureAlreadyCompleted

The Future being polled has already returned a completed value (or another error). In order to retry the request, create the Future again.

TwitterError(HeadersTwitterErrors)

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

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.