From 8440d59dd69594d8f09e640a02f0494544385d61 Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Fri, 26 Apr 2019 19:05:59 +0200 Subject: Cargo fmt --- src/errors.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 833e9c4..9f0a418 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -33,7 +33,10 @@ pub enum ContextualErrorKind { InvalidAuthFormat, /// This error might occure if the hash method is neither sha256 nor sha512 - #[fail(display = "{} is not a valid hashing method. Expected sha256 or sha512", _0)] + #[fail( + display = "{} is not a valid hashing method. Expected sha256 or sha512", + _0 + )] InvalidHashMethod(String), /// This error might occur if the HTTP auth hash password is not a valid hex code -- cgit v1.2.3 From 111a3dc44730e0e24a5aa4218e8e385b236a619d Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Fri, 26 Apr 2019 19:09:17 +0200 Subject: Merged query parameter structs + improved file upload errors --- src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 9f0a418..d34b447 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -68,6 +68,10 @@ pub enum ContextualErrorKind { _0 )] HTTPAuthenticationError(Box), + + /// This error might occur when an HTTP request is invalid + #[fail(display = "Invalid HTTP request\ncaused by: {}", _0)] + InvalidHTTPRequestError(String), } pub fn log_error_chain(description: String) { -- cgit v1.2.3 From 211250a71d9b2df27f85beb35b89d23346c6fa5e Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Sat, 27 Apr 2019 12:25:11 +0200 Subject: Improved some errors --- src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index d34b447..bf45b73 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -34,7 +34,7 @@ pub enum ContextualErrorKind { /// This error might occure if the hash method is neither sha256 nor sha512 #[fail( - display = "{} is not a valid hashing method. Expected sha256 or sha512", + display = "Invalid hashing method {}. Expected sha256 or sha512", _0 )] InvalidHashMethod(String), -- cgit v1.2.3 From f53a09b8d79c85b86b161c1ec7ca6f7cff5e169f Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Wed, 1 May 2019 13:17:13 +0200 Subject: Display HTTP authentication errors --- src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 8264de0..a22127e 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -65,6 +65,10 @@ pub enum ContextualError { )] HTTPAuthenticationError(Box), + /// This error might occur when the HTTP credentials are not correct + #[fail(display = "Invalid credentials for HTTP authentication")] + InvalidHTTPCredentials, + /// This error might occur when an HTTP request is invalid #[fail(display = "Invalid HTTP request\ncaused by: {}", _0)] InvalidHTTPRequestError(String), -- cgit v1.2.3 From e4bb38b17db665a8167feab9347494445385ebb3 Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Wed, 1 May 2019 17:01:41 +0200 Subject: Display 404 error --- src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index a22127e..e5d2e41 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -72,6 +72,10 @@ pub enum ContextualError { /// This error might occur when an HTTP request is invalid #[fail(display = "Invalid HTTP request\ncaused by: {}", _0)] InvalidHTTPRequestError(String), + + /// This error might occur when trying to access a page that does not exist + #[fail(display = "Route {} could not be found", _0)] + RouteNotFoundError(String), } pub fn log_error_chain(description: String) { -- cgit v1.2.3 From 5b43a629a8592c1a3f49a3e42d62713a96dee0c8 Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Mon, 6 May 2019 18:54:14 +0200 Subject: Undo changes on InvalidHashMethod error --- src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index e5d2e41..68f6d7d 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -32,7 +32,7 @@ pub enum ContextualError { InvalidAuthFormat, /// This error might occure if the hash method is neither sha256 nor sha512 - #[fail(display = "Invalid hashing method {}. Expected sha256 or sha512", _0)] + #[fail(display = "{} is not a valid hashing method. Expected sha256 or sha512", _0)] InvalidHashMethod(String), /// This error might occur if the HTTP auth hash password is not a valid hex code -- cgit v1.2.3