diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2019-05-10 13:20:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 13:20:40 +0000 |
commit | 8d1e14464201e6d0655794c1a9c7f0222ff45707 (patch) | |
tree | 19bcaee5e8fe4045147d88b6e3f4585ada053c19 /src/errors.rs | |
parent | Merge pull request #111 from svenstaro/dependabot/cargo/tar-0.4.25 (diff) | |
parent | Undo changes on args.rs (diff) | |
download | miniserve-8d1e14464201e6d0655794c1a9c7f0222ff45707.tar.gz miniserve-8d1e14464201e6d0655794c1a9c7f0222ff45707.zip |
Merge pull request #90 from boastful-squirrel/themed-errors
Themed errors
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index b8af25d..68f6d7d 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -64,6 +64,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) { |