Skip to content

Include error code in error string #895

@dcormier

Description

@dcormier

I've run into a number of times where I encounter a *pq.Error and realize I need some special handling for it. But I need to know the Postgres error code so I can check to make sure I'm handling the right error.

Currently, I have to look at the error string, try to figure out what error code it is (having neither the error code nor the condition name listed here), then add the needed special handling for the specific error code.

It would be really nice if the error string ((*pq.Error).Error()) just included the error code to ease special handling needed for that error.

Metadata

Metadata

Assignees

No one assigned

    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