Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = func(err error) dberrors.ErrType { if err == sql.ErrNoRows { return dberrors.DoesNotExist } pgErr, ok := err.(*pq.Error) if !ok { return dberrors.Other } if pgErr.Code.Name() == "unique_violation" { return dberrors.AlreadyExists } if pgErr.Code.Class().Name() == "integrity_constraint_violation" { return dberrors.IntegrityConstraintViolation } if pgErr.Code.Class().Name() == "data_exception" { return dberrors.InvalidInput } return dberrors.Other }
Analyzer converts a postgresql-specific error into a generic dberrors.ErrType
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.