Ensure Errors can be converted into Strings

This commit is contained in:
Tobie Morgan Hitchcock 2022-05-11 21:43:11 +01:00
parent f5687abeab
commit d29961ee19
2 changed files with 12 additions and 0 deletions

View file

@ -234,6 +234,12 @@ pub enum Error {
Decode(#[from] DecodeError),
}
impl From<Error> for String {
fn from(e: Error) -> String {
e.to_string()
}
}
#[cfg(feature = "kv-echodb")]
impl From<EchoDBError> for Error {
fn from(e: EchoDBError) -> Error {

View file

@ -38,6 +38,12 @@ pub enum Error {
impl warp::reject::Reject for Error {}
impl From<Error> for String {
fn from(e: Error) -> String {
e.to_string()
}
}
impl From<Base64Error> for Error {
fn from(_: Base64Error) -> Error {
Error::InvalidAuth