httperror

package
v0.0.0-...-6bfe346 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = NotFound("not found")
	ErrInternal = New(http.StatusInternalServerError, "internal", "internal server error")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Status  int    `json:"status"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

func BadRequest

func BadRequest(code, msg string, args ...interface{}) Error

func From

func From(err error, debug bool) Error

func New

func New(status int, code, msg string, args ...interface{}) Error

func NotFound

func NotFound(msg string, args ...interface{}) Error

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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