Add from reqwesterror for manifolderror

This commit is contained in:
Lucy Bladen 2021-11-12 13:52:33 +00:00
parent c6f1add119
commit 136f2b7a9b
2 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,7 @@ log = "0.4.14"
r2d2 = "0.8.9" r2d2 = "0.8.9"
rand = "0.8.4" rand = "0.8.4"
regex = "1.5.4" regex = "1.5.4"
reqwest = "0.11.6"
serde_json = "1.0.69" serde_json = "1.0.69"
serenity = { version = "0.10", features = [ "collector" ] } serenity = { version = "0.10", features = [ "collector" ] }
tokio = { version = "1.13.0", features = ["sync", "macros", "rt-multi-thread"] } tokio = { version = "1.13.0", features = ["sync", "macros", "rt-multi-thread"] }

View File

@ -1,6 +1,7 @@
use std::error::Error; use std::error::Error;
use std::fmt; use std::fmt;
use serenity::prelude::SerenityError; use serenity::prelude::SerenityError;
use reqwest::Error as ReqwestError;
pub type ManifoldResult<T> = Result<T, ManifoldError>; pub type ManifoldResult<T> = Result<T, ManifoldError>;
@ -70,3 +71,9 @@ impl From<SerenityError> for ManifoldError {
ManifoldError::new(&err.to_string()) ManifoldError::new(&err.to_string())
} }
} }
impl From<ReqwestError> for ManifoldError {
fn from(err: ReqwestError) -> Self {
ManifoldError::new(&err.to_string())
}
}