diff options
-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 9559ae6..34fea2d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -19,6 +19,7 @@ use std; #[derive(Debug)] pub enum Error { + APIError(String), Http(reqwest::Error), Io(std::io::Error), Json(serde_json::Error), @@ -50,3 +51,9 @@ impl From<serde_qs::Error> for Error { Error::Qs(e) } } + +impl From<&str> for Error { + fn from(msg: &str) -> Error { + Error::APIError(msg.to_string()) + } +} |