Skip to content

Dialector.Translate(error) omits original error message #332

@Vovan-VE

Description

@Vovan-VE

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions