apperr

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	Code    int
	Message string
	Data    any
}

func New

func New(code int, msg string) *HTTPError

New returns a new HTTPError with the given code and message. The Data field is set to nil.

func NewWithData added in v1.1.1

func NewWithData(code int, msg string, data any) *HTTPError

NewWithData returns a new HTTPError with the given code, message, and data. The Data field is used to provide additional context or information related to the error.

func (HTTPError) Error

func (e HTTPError) Error() string

Error implements the error interface, returning the message string.

Jump to

Keyboard shortcuts

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