diff --git a/error_translator.go b/error_translator.go index 38238fd..bf91276 100644 --- a/error_translator.go +++ b/error_translator.go @@ -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,