Ensure Errors can be converted into Strings
This commit is contained in:
parent
f5687abeab
commit
d29961ee19
2 changed files with 12 additions and 0 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue