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

pub enum Error {
    BadUrl,
    InvalidResponse(&'static strOption<String>),
    MissingValue(&'static str),
    FutureAlreadyCompleted,
    TwitterError(TwitterErrors),
    RateLimit(i32),
    MediaError(MediaError),
    BadStatus(StatusCode),
    NetError(Error),
    TlsError(Error),
    IOError(Error),
    DeserializeError(Error),
    TimestampParseError(ParseError),
    TimerShutdownError(Error),
    HeaderParseError(ToStrError),
    HeaderConvertError(ParseIntError),
}

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(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

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<Error> for Error[src]

impl From<ParseError> for Error[src]

impl From<Error> for Error[src]

impl From<ToStrError> for Error[src]

impl From<ParseIntError> for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]

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

Auto Trait Implementations

impl Send for Error

impl Sync for Error

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self