summaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 72eb837..2251ad4 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -55,3 +55,10 @@ impl From<sqlx::Error> for AppError {
AppError::Database
}
}
+
+/// Raise a generic error from a string
+impl From<std::string::String> for AppError {
+ fn from(error: std::string::String) -> AppError {
+ AppError::BadRequest(error)
+ }
+}