Skip to content

Commit

Permalink
feat: reference for error codes added
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeid Saeidee authored and a631807682 committed Jun 12, 2023
1 parent 3f88908 commit 48b6526
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions error_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"gorm.io/gorm"
)

// The error codes to map mysql errors to gorm errors, here is the mysql error codes reference https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html.
var errCodes = map[uint16]error{
1062: gorm.ErrDuplicatedKey,
1452: gorm.ErrForeignKeyViolated,
Expand Down

0 comments on commit 48b6526

Please sign in to comment.