Enum rawr::errors::APIError [] [src]

pub enum APIError {
    ExhaustedListing,
    HTTPError(StatusCode),
    HyperError(Error),
    JSONError(Error),
}

Error type that occurs when an API request fails for some reason.

Variants

ExhaustedListing

Occurs when a listing has run out of results. Only used internally - the Listing class will not raise this when iterating.

HTTPError

Occurs when the API has returned a non-success error code. Important status codes include: - 401 Unauthorized - this usually occurs if your tokens are incorrect or invalid - 403 Forbidden - you are not allowed to access this, but your request was valid.

HyperError

Occurs if the HTTP response from Reddit was corrupt and Hyper could not parse it.

JSONError

Occurs if JSON deserialization fails. This will always be a bug, so please report it if it does occur, but the error type is provided so you can fail gracefully.

Trait Implementations

impl Display for APIError
[src]

fn fmt(&self, f: &mut Formatter) -> FmtResult

Formats the value using the given formatter.

impl Error for APIError
[src]

fn description(&self) -> &str

A short description of the error. Read more

fn cause(&self) -> Option<&Error>
1.0.0

The lower-level cause of this error, if any.

impl From<Error> for APIError
[src]

fn from(err: Error) -> APIError

Performs the conversion.

impl From<Error> for APIError
[src]

fn from(err: Error) -> APIError

Performs the conversion.

Derived Implementations

impl Debug for APIError
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.