pgconv

package
v0.0.0-...-3215105 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2018 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL