errors

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationError

type ApplicationError interface {
	//TODO Should we embed log.Error in here and add a new function New(err errors, code, message string) *ApplicationError
	Error() string
	String() string
	ErrorCode() string
	ErrorMessage() string
}

ApplicationError is an interface to all application errors It provides functions to get the error code and error message

type BaseApplicationError

type BaseApplicationError struct {
	Message string
	Code    string
}

BaseApplicationError implements the `ApplicationError`

func (*BaseApplicationError) Error

func (e *BaseApplicationError) Error() string

Error returns string representation of error

func (*BaseApplicationError) ErrorCode

func (e *BaseApplicationError) ErrorCode() string

ErrorCode returns the unique code of the error

func (*BaseApplicationError) ErrorMessage

func (e *BaseApplicationError) ErrorMessage() string

ErrorMessage returns the readable message of the error

func (*BaseApplicationError) String

func (e *BaseApplicationError) String() string

String implementation supports logging

Jump to

Keyboard shortcuts

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