apierrors

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeInternal = 900
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	ErrorCode    int
	ErrorMessage string
	Details      map[string]interface{} `json:",omitempty"`
	// contains filtered or unexported fields
}

func New

func New(
	httpStatusCode int,
	errorCode int,
	errorMessage string,
	err error,
) Error

func NewBusinessError

func NewBusinessError(errorCode int, errorMessage string, err error) Error

func NewInternalServiceError

func NewInternalServiceError(err error) Error

func (Error) Error

func (e Error) Error() string

func (Error) LogLevel

func (e Error) LogLevel() log.Level

func (Error) WithDetails

func (e Error) WithDetails(details map[string]any) Error

func (Error) WithLogLevel

func (e Error) WithLogLevel(level log.Level) Error

func (Error) WriteError

func (e Error) WriteError(w http.ResponseWriter) error

Jump to

Keyboard shortcuts

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