Documentation
¶
Overview ¶
Package mehpg provides error functionality regarding postgres-errors.
Index ¶
Constants ¶
const ( ErrCodePrefixDataException = "22" ErrCodePrefixIntegrityConstraintViolation = "23" ErrCodePrefixSyntaxErrOrAccessRuleViolation = "42" )
Prefixes for PostgreSQL error codes.
See: https://www.postgresql.org/docs/13/errcodes-appendix.html.
Variables ¶
This section is empty.
Functions ¶
func NewQueryAndScanRowsErr ¶ added in v1.8.0
NewQueryAndScanRowsErr is used for errors returned from QueryRow with Scan. Further logic might be added in the future.
func NewQueryDBErr ¶
NewQueryDBErr creates a new meh.Error with the given error and message and sets a field in details to the provided query. If the error is related to constraint violation or data exceptions, a meh.ErrBadInput will be returned. Otherwise, meh.ErrInternal.
func NewScanRowsErr ¶
NewScanRowsErr creates a new meh.ErrInternal with the given error and message and saves the provided query to details. The used logic is currently the same as NewQueryDBErr but placed in a separate method for future adjustments.
Types ¶
This section is empty.