diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2022-09-10 15:23:02 +0000 |
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-10 15:23:02 +0000 |
| commit | 2a90d0ff8d4336850a450f749140e2df2e94fc56 (patch) | |
| tree | cf6a0d94ad7f56068093a836d302cdc090747d3a /src/errors.rs | |
| parent | 58d6870c33d664157c3efc9c75686e6c0779a96f (diff) | |
Upload files
Diffstat (limited to 'src/errors.rs')
| -rw-r--r-- | src/errors.rs | 7 |
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) + } +} |
