errs

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorsHandler added in v1.2.0

func ErrorsHandler(errs interface{}) map[string]string

ErrorsHandler returns map

Types

type Error

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

Error implements generic error interface

type Failure

type Failure struct {
	// contains filtered or unexported fields
}

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.

func (*Failure) SetApiError added in v1.2.0

func (f *Failure) SetApiError(e string)

SetApiError set api error value

func (*Failure) SetApiErrors added in v1.2.0

func (f *Failure) SetApiErrors(e map[string]string)

SetApiErrors set api errors value

func (*Failure) SetRuntimeError added in v1.2.0

func (f *Failure) SetRuntimeError(e error)

SetRuntimeError set runtime error value

type FailureResponse

type FailureResponse struct {
	ErrorMsg string      `json:"errorMsg,omitempty"`
	Errors   interface{} `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