Documentation ¶
Index ¶
- Constants
- func Code(e error) string
- func Message(e error) string
- func New(code string, text string) error
- func NewErrorDatabaseDuplicated(text string) error
- func NewErrorEmptySqlResult(text string) error
- func NewErrorNilEntityValue(text string) error
- func NewErrorNoRowsAffected(text string) error
- type CommonsError
Constants ¶
View Source
const ( ErrorNilEntityValue = "ERROR_NIL_ENTITY_VALUE" ErrorEmptySqlResult = "ERROR_EMPTY_SQL_RESULT" ErrorDatabaseDuplicated = "ERROR_DUPLICATED_ENTRY" ErrorNoRowsAffected = "ERROR_SQL_NO_ROWS_AFFECTED" ErrorGeneratingRsa = "ERROR_GENERATING_RSA" )
Variables ¶
This section is empty.
Functions ¶
func Message ¶
Returns the CommonsError message
If e is not type of CommonsError returns an empty string
func New ¶
New returns an error that formats as the given code and text (the message). Each call to New returns a distinct error value even if the text is identical.
func NewErrorDatabaseDuplicated ¶ added in v0.1.3
func NewErrorEmptySqlResult ¶ added in v0.1.3
func NewErrorNilEntityValue ¶ added in v0.1.3
func NewErrorNoRowsAffected ¶ added in v0.1.3
Types ¶
type CommonsError ¶ added in v0.1.3
CommonsError is a trivial implementation of error.
func GetCommonsError ¶ added in v0.1.3
func GetCommonsError(err error) *CommonsError
func (CommonsError) Error ¶ added in v0.1.3
func (e CommonsError) Error() string
func (CommonsError) MarshalJSON ¶ added in v0.1.3
func (e CommonsError) MarshalJSON() ([]byte, error)
Implements the json.Marshaler interface to control JSON serialization.
func (*CommonsError) Scan ¶ added in v0.1.3
func (e *CommonsError) Scan(value interface{}) error
Implements the sql.Scanner interface to be able to read it from MySQL
func (*CommonsError) String ¶ added in v0.1.3
func (e *CommonsError) String() string
Click to show internal directories.
Click to hide internal directories.