diff --git a/src/upload.rs b/src/upload.rs index 5b1bd59..9357648 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -22,6 +22,8 @@ enum Error { Parse(#[from] serde_json::Error), #[error("Error writing to stored file")] Storage(#[from] std::io::Error), + #[error("Time formatting error")] + TimeFormat(#[from] time::error::Format), #[error("Duplicate filename could not be deduplicated")] DuplicateFilename, #[error("This message type was not expected at this stage")] @@ -43,7 +45,8 @@ enum Error { impl Error { fn close_code(&self) -> CloseCode { match self { - Self::Storage(_) => CloseCode::Error, + Self::Storage(_) + | Self::TimeFormat(_) => CloseCode::Error, Self::Parse(_) | Self::UnexpectedMessageType | Self::ClosedEarly(_) @@ -242,7 +245,7 @@ impl Uploader { let zip_writer = super::zip::ZipGenerator::new(files, writer); let size = zip_writer.total_size(); let download_filename = - super::APP_NAME.to_owned() + &now.format(FILENAME_DATE_FORMAT).unwrap() + ".zip"; + super::APP_NAME.to_owned() + &now.format(FILENAME_DATE_FORMAT)? + ".zip"; ( Box::new(zip_writer), download_filename, diff --git a/static/index.html b/static/index.html index d792bb1..59ba3c6 100644 --- a/static/index.html +++ b/static/index.html @@ -4,27 +4,21 @@ - - transbeam - - - - - -
-
-
- + + -
+ + + + + -
-