error

package
v0.0.0-...-920a7e7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 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 Response

type Response struct {
	Valid     bool
	Err       error
	ErrorType Type
}

func GetErrorResponse

func GetErrorResponse(err error) Response

GetErrorResponse will get the type of err, if the type is a ErrorResponse it will return that as an ErrorResponse, otherwise it will construct a new default ErrorResponse

func NewErrorResponse

func NewErrorResponse(errorType Type, errorMessage string) *Response

func NewErrorResponseWithError

func NewErrorResponseWithError(errorType Type, err error) *Response

func NewErrorResponseWithErrorAndMsg

func NewErrorResponseWithErrorAndMsg(errorType Type, err error, msg string) *Response

func NewErrorResponseWithErrorAndMsgf

func NewErrorResponseWithErrorAndMsgf(errorType Type, err error, msg string, a ...interface{}) *Response

func NewErrorResponsef

func NewErrorResponsef(errorType Type, msg string, a ...interface{}) *Response

func (*Response) Error

func (r *Response) Error() string

func (*Response) IsUnknownError

func (r *Response) IsUnknownError() bool

type Type

type Type string
const (
	ApplicationError Type = "ApplicationError"
	CriticalError    Type = "CriticalError"
	UnknownError     Type = "UnknownError"
)

Jump to

Keyboard shortcuts

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