Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PGConverter ¶
type PGConverter struct {
// contains filtered or unexported fields
}
PGConverter is an implementation of dberrorsrrors.Converter.
func New ¶
func New() *PGConverter
New creates new PGConverter It is already inited and ready to use.
func (*PGConverter) Convert ¶
func (p *PGConverter) Convert(err error) (dberrorsErr *dberrors.Error)
Convert converts the given error into *Error. The method checks if given error is of known type, and then returns it.ty If an error is unknown it returns new 'dberrorsrrors.ErrUnspecifiedError'. At first converter checks if an error is of *pq.Error type. Having a postgres *pq.Error it checks if an ErrorCode is in the map, and returns it if true. Otherwise method checks if the ErrorClass exists in map. If it is present, new *Error of given type is returned.
Click to show internal directories.
Click to hide internal directories.