From 23567f3b73ef309ba9afda51e084751b64942c53 Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Sun, 21 Apr 2019 19:21:59 +0200 Subject: Print upload/archive errors also in terminal --- src/file_upload.rs | 1 + src/listing.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/file_upload.rs b/src/file_upload.rs index 960f831..54c56dd 100644 --- a/src/file_upload.rs +++ b/src/file_upload.rs @@ -175,6 +175,7 @@ fn create_error_response( description: &str, return_path: &str, ) -> FutureResult { + log::error!("{}", description); future::ok( HttpResponse::BadRequest() .content_type("text/html; charset=utf-8") diff --git a/src/listing.rs b/src/listing.rs index a9e4f5f..4473c6d 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -261,9 +261,12 @@ pub fn directory_listing( .chunked() .body(Body::Streaming(Box::new(once(Ok(content)))))) } - Err(err) => Ok(HttpResponse::Ok() - .status(http::StatusCode::INTERNAL_SERVER_ERROR) - .body(err.to_string())), + Err(err) => { + log::error!("{}", &err); + Ok(HttpResponse::Ok() + .status(http::StatusCode::INTERNAL_SERVER_ERROR) + .body(err.to_string())) + } } } else { Ok(HttpResponse::Ok() -- cgit v1.2.3