diff --git a/src/paste.rs b/src/paste.rs index e09f95b..32a3212 100644 --- a/src/paste.rs +++ b/src/paste.rs @@ -116,8 +116,9 @@ impl Paste { if let Some(max_dir_size) = config.server.max_upload_dir_size { let file_size = u64::try_from(self.data.len()).unwrap_or_default(); let upload_dir = self.type_.get_path(&config.server.upload_path)?; - let current_size_of_upload_dir = util::get_dir_size(&upload_dir) - .map_err(|_| error::ErrorInternalServerError("Internal server error occured"))?; + let current_size_of_upload_dir = util::get_dir_size(&upload_dir).map_err(|e| { + error::ErrorInternalServerError(format!("could not get directory size: {e}")) + })?; let expected_size_of_upload_dir = current_size_of_upload_dir.add(file_size); if expected_size_of_upload_dir > max_dir_size { return Err(error::ErrorInsufficientStorage(