Common error type and admin error type that uses it

This commit is contained in:
Alex Auvolat
2022-05-13 14:30:30 +02:00
parent 983037d965
commit c0fb9fd0fe
11 changed files with 249 additions and 29 deletions
+4
View File
@@ -166,6 +166,10 @@ impl Error {
_ => "InvalidRequest",
}
}
pub fn bad_request<M: ToString>(msg: M) -> Self {
Self::BadRequest(msg.to_string())
}
}
impl ApiError for Error {