#[derive(Debug, Fail)]
pub enum RedditError {
#[fail(display = "Requested resource {} was not found", request)]
NotFound {
request: String,
},
#[fail(display = "Requested resource {} is forbidden", request)]
Forbidden {
request: String,
},
#[fail(display = "\nSent request {}, got unexpected reponse {}\n", request, response)]
BadResponse {
request: String,
response: String,
},
#[fail(display = "\nAttempted incorrect request {} got response {}\n", request, response)]
BadRequest {
request: String,
response: String,
},
#[fail(display = "Failed to authorize")]
AuthError,
}
#[derive(Debug, Fail)]
#[fail(display = "Could not parse json {} as {}\n", json, thing_type)]
pub struct ParseError {
pub thing_type: String,
pub json: String,
}