From 48b6526a21f019d2357ca6abbe5c1db5be3d5451 Mon Sep 17 00:00:00 2001 From: Saeid Saeidee Date: Sat, 10 Jun 2023 21:00:29 +0200 Subject: [PATCH] feat: reference for error codes added --- error_translator.go | 1 + 1 file changed, 1 insertion(+) 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,