err.description is deprecated (#537)

This commit is contained in:
samuela 2020-03-09 00:12:57 -07:00 committed by GitHub
parent 51b86af13b
commit 1411969c37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,17 +365,7 @@ impl fmt::Display for GraphQLRequestError {
} }
impl Error for GraphQLRequestError { impl Error for GraphQLRequestError {
fn description(&self) -> &str { fn source(&self) -> Option<&(dyn Error + 'static)> {
match *self {
GraphQLRequestError::BodyHyper(ref err) => err.description(),
GraphQLRequestError::BodyUtf8(ref err) => err.description(),
GraphQLRequestError::BodyJSONError(ref err) => err.description(),
GraphQLRequestError::Variables(ref err) => err.description(),
GraphQLRequestError::Invalid(ref err) => err,
}
}
fn cause(&self) -> Option<&dyn Error> {
match *self { match *self {
GraphQLRequestError::BodyHyper(ref err) => Some(err), GraphQLRequestError::BodyHyper(ref err) => Some(err),
GraphQLRequestError::BodyUtf8(ref err) => Some(err), GraphQLRequestError::BodyUtf8(ref err) => Some(err),