mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
feat: migrate fetch captcha config to use db_*
This commit is contained in:
@@ -240,20 +240,20 @@ impl From<CaptchaError> for ServiceError {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
impl From<sqlx::Error> for ServiceError {
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
fn from(e: sqlx::Error) -> Self {
|
||||
use sqlx::error::Error;
|
||||
use std::borrow::Cow;
|
||||
if let Error::Database(err) = e {
|
||||
if err.code() == Some(Cow::from("23505")) {
|
||||
return ServiceError::UsernameTaken;
|
||||
}
|
||||
}
|
||||
ServiceError::InternalServerError
|
||||
}
|
||||
}
|
||||
//#[cfg(not(tarpaulin_include))]
|
||||
//impl From<sqlx::Error> for ServiceError {
|
||||
// #[cfg(not(tarpaulin_include))]
|
||||
// fn from(e: sqlx::Error) -> Self {
|
||||
// use sqlx::error::Error;
|
||||
// use std::borrow::Cow;
|
||||
// if let Error::Database(err) = e {
|
||||
// if err.code() == Some(Cow::from("23505")) {
|
||||
// return ServiceError::UsernameTaken;
|
||||
// }
|
||||
// }
|
||||
// ServiceError::InternalServerError
|
||||
// }
|
||||
//}
|
||||
|
||||
#[cfg(not(tarpaulin_include))]
|
||||
impl From<SmtpError> for ServiceError {
|
||||
|
||||
Reference in New Issue
Block a user