Description
When an error translated, original error message is omitted, and exactly predefined error is returned without details. So you getting for example "invalid field" without original error message from *pgconn.PgError where concrete field said.
|
func (dialector Dialector) Translate(err error) error { |
|
if pgErr, ok := err.(*pgconn.PgError); ok { |
|
if translatedErr, found := errCodes[pgErr.Code]; found { |
|
return translatedErr |
The solution might be nested errors, to errors.Is() will work the same.
Description
When an
errortranslated, original error message is omitted, and exactly predefined error is returned without details. So you getting for example"invalid field"without original error message from*pgconn.PgErrorwhere concrete field said.postgres/error_translator.go
Lines 27 to 30 in 1ffb5a7
The solution might be nested errors, to
errors.Is()will work the same.