errors

package
v2.0.0-...-4e8a7ef Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFound                    = New("Not Found", 404)
	BadRequest                  = New("Bad Request", 400)
	Unauthorized                = New("Unauthorized", 401)
	Forbidden                   = New("Forbidden", 403)
	Internal                    = New("Internal Server Error", 500)
	NotAcceptable               = New("Not Acceptable", 406)
	Conflict                    = New("Conflict", 409)
	Precondition                = New("Precondition Failed", 412)
	UnsupportedMedia            = New("Unsupported Media Type", 415)
	Gone                        = New("Gone", 410)
	RequestTimeout              = New("Request Timeout", 408)
	RequestEntityTooLarge       = New("Request Entity Too Large", 413)
	RequestURITooLong           = New("Request URI Too Long", 414)
	RequestHeaderFieldsTooLarge = New("Request Header Fields Too Large", 431)
	UnavailableForLegalReasons  = New("Unavailable For Legal Reasons", 451)
	PayloadTooLarge             = New("Payload Too Large", 413)
	TooManyRequests             = New("Too Many Requests", 429)
)

Functions

This section is empty.

Types

type HTTPError

type HTTPError outcome.Response

func New

func New(err ...interface{}) HTTPError

func (HTTPError) Code

func (e HTTPError) Code(code int) HTTPError

type Response

type Response struct {
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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