user secret

This commit is contained in:
realaravinth
2021-04-10 21:00:30 +05:30
parent 7777db477e
commit 884cb25e02
3 changed files with 48 additions and 9 deletions

View File

@@ -204,7 +204,9 @@ 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 {