diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 1e349d9..9559ae6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -21,6 +21,7 @@ use std; pub enum Error { Http(reqwest::Error), Io(std::io::Error), + Json(serde_json::Error), Qs(serde_qs::Error), Unauthorized, Unknown, @@ -38,6 +39,12 @@ impl From<std::io::Error> for Error { } } +impl From<serde_json::Error> for Error { + fn from(e: serde_json::Error) -> Error { + Error::Json(e) + } +} + impl From<serde_qs::Error> for Error { fn from(e: serde_qs::Error) -> Error { Error::Qs(e) |