From ebcdd5b4f5029d5603c0af81d5dd33b564b29d8e Mon Sep 17 00:00:00 2001 From: Franklin Date: Thu, 8 Sep 2022 12:49:57 -0400 Subject: [PATCH] Made error implement std::error::Error --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/enums/error.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85df741..f04d8b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "actix-web-utils" -version = "0.2.14" +version = "0.2.15" dependencies = [ "actix-web", "log", diff --git a/Cargo.toml b/Cargo.toml index 8b42d09..3ea387b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web-utils" -version = "0.2.14" +version = "0.2.15" edition = "2021" authors = ["Franklin E. Blanco"] description = "Just some useful addons for actix web." diff --git a/src/enums/error.rs b/src/enums/error.rs index 148ce11..63e9afc 100644 --- a/src/enums/error.rs +++ b/src/enums/error.rs @@ -5,6 +5,7 @@ use crate::dtos::message::MessageResource; /// This is supposed to be used whenever you have an error in your code and want to be more specific about it. /// Fits in with most CRUD web apps. What you send back to the client is a MessageResource, not the error itself! +#[derive(Debug)] pub enum Error{ /// Takes a Message and the query DatabaseError(MessageResource, String), @@ -34,4 +35,5 @@ impl fmt::Display for Error{ Error::ComputeError(message) => write!(f, "Error of type Compute.\nMessageResource: {}", message), } } -} \ No newline at end of file +} +impl std::error::Error for Error {} \ No newline at end of file