refactor(error): Better errors from the Mastodon API
This commit is contained in:
+3
-1
@@ -275,7 +275,9 @@ impl fmt::Display for Error {
|
|||||||
impl StdError for Error {
|
impl StdError for Error {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match *self {
|
match *self {
|
||||||
Error::Api(ref e) => &e.error,
|
Error::Api(ref e) => {
|
||||||
|
e.error_description.as_ref().unwrap_or(&e.error)
|
||||||
|
},
|
||||||
Error::Serde(ref e) => e.description(),
|
Error::Serde(ref e) => e.description(),
|
||||||
Error::Http(ref e) => e.description(),
|
Error::Http(ref e) => e.description(),
|
||||||
Error::Io(ref e) => e.description(),
|
Error::Io(ref e) => e.description(),
|
||||||
|
|||||||
Reference in New Issue
Block a user