errs

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error interface {
	error
	ApiError() string
	ApiErrors() map[string]string
}

Error implements generic error interface

type Failure

type Failure struct {
	RuntimeErr error
	ApiErr     string
	ApiErrs    map[string]string
}

Failure struct implode runtime & api errors

func (*Failure) ApiError

func (f *Failure) ApiError() string

ApiError returns formatted string representation of the API error

func (*Failure) ApiErrors

func (f *Failure) ApiErrors() map[string]string

ApiErrors returns array of formatted strings that represents API errors

func (*Failure) Error

func (f *Failure) Error() string

Error returns the string representation of the error and satisfies the error interface.

type FailureResponse

type FailureResponse struct {
	ErrorMsg string            `json:"errorMsg,omitempty"`
	Errors   map[string]string `json:"errors,omitempty"`
}

FailureResponse convert json error response into object

func ErrorResponse

func ErrorResponse(data []byte) (FailureResponse, error)

ErrorResponse method

Jump to

Keyboard shortcuts

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