mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
Merge branch 'main' into media_refactor
This commit is contained in:
@@ -19,7 +19,7 @@ func processPostgresError(err error) db.Error {
|
||||
// (https://www.postgresql.org/docs/10/errcodes-appendix.html)
|
||||
switch pgErr.Code {
|
||||
case "23505" /* unique_violation */ :
|
||||
return db.ErrAlreadyExists
|
||||
return db.NewErrAlreadyExists(pgErr.Message)
|
||||
default:
|
||||
return err
|
||||
}
|
||||
@@ -36,7 +36,7 @@ func processSQLiteError(err error) db.Error {
|
||||
// Handle supplied error code:
|
||||
switch sqliteErr.Code() {
|
||||
case sqlite3.SQLITE_CONSTRAINT_UNIQUE, sqlite3.SQLITE_CONSTRAINT_PRIMARYKEY:
|
||||
return db.ErrAlreadyExists
|
||||
return db.NewErrAlreadyExists(err.Error())
|
||||
default:
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user