mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
update user secret
This commit is contained in:
@@ -187,16 +187,11 @@ impl From<sqlx::Error> for ServiceError {
|
||||
fn from(e: sqlx::Error) -> Self {
|
||||
use sqlx::error::Error;
|
||||
use std::borrow::Cow;
|
||||
|
||||
println!("{:?}", &e);
|
||||
if let Error::Database(err) = e {
|
||||
if err.code() == Some(Cow::from("23505")) {
|
||||
return ServiceError::UsernameTaken;
|
||||
}
|
||||
|
||||
println!("{:?}", &err.code());
|
||||
}
|
||||
|
||||
ServiceError::InternalServerError
|
||||
}
|
||||
}
|
||||
@@ -204,9 +199,7 @@ impl From<sqlx::Error> for ServiceError {
|
||||
pub fn dup_error(e: sqlx::Error, dup_error: ServiceError) -> ServiceError {
|
||||
use sqlx::error::Error;
|
||||
use std::borrow::Cow;
|
||||
// println!("sqlx:Error: {:#?}", &e);
|
||||
if let Error::Database(err) = e {
|
||||
// println!("Database Error: {:#?}", &err);
|
||||
if err.code() == Some(Cow::from("23505")) {
|
||||
dup_error
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user