diff options
author | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-04-21 22:39:38 +0000 |
---|---|---|
committer | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-04-21 22:39:38 +0000 |
commit | 6dad3eb1bf0cb3b36cdb3b312cca7caa91de2f57 (patch) | |
tree | fffc75935db79ef4b08c8502f5afe9ca9470867a /src/errors.rs | |
parent | Print upload/archive errors also in terminal (diff) | |
download | miniserve-6dad3eb1bf0cb3b36cdb3b312cca7caa91de2f57.tar.gz miniserve-6dad3eb1bf0cb3b36cdb3b312cca7caa91de2f57.zip |
Properly log error + added render_error method
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index f2d185e..2bf4130 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -50,6 +50,12 @@ pub enum ContextualErrorKind { ArchiveCreationError(String, Box<ContextualError>), } +pub fn log_error_chain(description: String) { + for cause in description.lines() { + log::error!("{}", cause); + } +} + /// Based on https://boats.gitlab.io/failure/error-errorkind.html pub struct ContextualError { inner: Context<ContextualErrorKind>, |