aboutsummaryrefslogtreecommitdiff
path: root/src/api/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/error.rs')
-rw-r--r--src/api/error.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/error.rs b/src/api/error.rs
index d945295a..f53ed1fd 100644
--- a/src/api/error.rs
+++ b/src/api/error.rs
@@ -126,6 +126,12 @@ impl From<HelperError> for Error {
}
}
+impl From<multer::Error> for Error {
+ fn from(err: multer::Error) -> Self {
+ Self::BadRequest(err.to_string())
+ }
+}
+
impl Error {
/// Get the HTTP status code that best represents the meaning of the error for the client
pub fn http_status_code(&self) -> StatusCode {