errors

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 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() string
	Code() string
	Message() string
	SetMessage(string) Error
	Params() map[string]interface{}
	SetParams(map[string]interface{}) Error
}

Error interface represents an validation error

func New

func New(code, message string) Error

New create new validation error.

type ErrorObject

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

func (ErrorObject) AddParam

func (e ErrorObject) AddParam(name string, value interface{}) Error

AddParam add parameter to the error's parameters.

func (ErrorObject) Code

func (e ErrorObject) Code() string

Code get the error's translation code.

func (ErrorObject) Error

func (e ErrorObject) Error() string

Error returns the error message.

func (ErrorObject) Message

func (e ErrorObject) Message() string

Message return the error's message.

func (ErrorObject) Params

func (e ErrorObject) Params() map[string]interface{}

Params returns the error's params.

func (ErrorObject) SetCode

func (e ErrorObject) SetCode(code string) Error

SetCode set the error's translation code.

func (ErrorObject) SetMessage

func (e ErrorObject) SetMessage(message string) Error

SetMessage set the error's message.

func (ErrorObject) SetParams

func (e ErrorObject) SetParams(params map[string]interface{}) Error

Jump to

Keyboard shortcuts

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