aboutsummaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
authorkhai96_ <hvksmr1996@gmail.com>2019-05-17 07:11:38 +0000
committerkhai96_ <hvksmr1996@gmail.com>2019-05-17 07:11:38 +0000
commita77c71dde6a480c8c6a096b7cacd03de63a5ee6b (patch)
tree41709cb3662e07031cf318cb64404ea2d645bf92 /src/errors.rs
parentUpdate unit tests (diff)
parentMerge pull request #116 from svenstaro/dependabot/cargo/reqwest-0.9.17 (diff)
downloadminiserve-a77c71dde6a480c8c6a096b7cacd03de63a5ee6b.tar.gz
miniserve-a77c71dde6a480c8c6a096b7cacd03de63a5ee6b.zip
Merge remote-tracking branch 'mainrepo/master' into multiple-auths-alt
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs
index b8af25d..2878e37 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -32,7 +32,10 @@ pub enum ContextualError {
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
@@ -64,6 +67,18 @@ pub enum ContextualError {
_0
)]
HTTPAuthenticationError(Box<ContextualError>),
+
+ /// 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),
+
+ /// 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) {