errors

package
v5.1.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCode4XX = "4XX"
	ErrorCode5XX = "5XX"
)
View Source
const ErrParse = "******************ERROR DURING MARSHAL OF FULL MESSAGE*******************"

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomError

type CustomError struct {
	ErrorData        interface{} `json:"errorData"`
	ErrorMessage     string      `json:"errorMessage"`
	ErrorDescription interface{} `json:"errorDescription"`
	ErrorCode        string      `json:"errorCode"`
	Notify           bool        `json:"-"`
	OriginalError    string      `json:"error"`
}

func NewCustomError

func NewCustomError(errorCode, errorMessage string, errorData interface{}, errorDescription interface{}, notify bool, err error) *CustomError

func (*CustomError) Error

func (e *CustomError) Error() string

func (*CustomError) GetErrorResponse

func (e *CustomError) GetErrorResponse() ([]byte, error)

type ErrorNotifier

type ErrorNotifier interface {
	Send5XX(ctx context.Context, errorCode string, err error, stackTrace string, errorData interface{}) error
	Send4XX(ctx context.Context, errorCode string, err error, stackTrace string, errorData interface{}) error
}

type HTTPError

type HTTPError struct {
	CustomError
	StatusCode int `json:"statusCode"`
}

func NewHTTPClientError

func NewHTTPClientError(statusCode int, errorCode, errorMessage string, errorData interface{}, errorDescription interface{}, err error) *HTTPError

func NewHTTPError

func NewHTTPError(statusCode int, errorCode, errorMessage string, errorData interface{}, errorDescription interface{}, notify bool, err error) *HTTPError

func NewHTTPServerError

func NewHTTPServerError(statusCode int, errorCode, errorMessage string, errorData interface{}, errorDescription interface{}, err error) *HTTPError

Directories

Path Synopsis
notifier

Jump to

Keyboard shortcuts

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