aboutsummaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-04-21 22:39:38 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-04-21 22:39:38 +0000
commit6dad3eb1bf0cb3b36cdb3b312cca7caa91de2f57 (patch)
treefffc75935db79ef4b08c8502f5afe9ca9470867a /src/errors.rs
parentPrint upload/archive errors also in terminal (diff)
downloadminiserve-6dad3eb1bf0cb3b36cdb3b312cca7caa91de2f57.tar.gz
miniserve-6dad3eb1bf0cb3b36cdb3b312cca7caa91de2f57.zip
Properly log error + added render_error method
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs6
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>,