Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrCodeInvalid = 400 // Invalid request ErrCodeNoAuth = 401 // No authentication ErrCodeForbidden = 403 // Forbidden ErrCodeNotFound = 404 // Not found ErrCodeNoMethod = 405 // Method not allowed ErrCodeUnacceptable = 406 // Unacceptable request format ErrCodeProxyAuthRequired = 407 // Proxy authentication required ErrCodeRQTimeout = 408 // Request timeout ErrCodeTeapot = 418 // I'm a teapot ErrCodeInternal = 500 // Internal server error ErrCodeNYI = 501 // Not yet implemented ErrCodeBadGateway = 502 // Bad gateway interface )
Variables ¶
This section is empty.
Functions ¶
func IsRouterError ¶
Check if the error is a RouterError and if the error code matches the specified error code.
Types ¶
type ErrorThrower ¶
type ErrorThrower interface { Error(code int, message string) RouterError Throw(code int) }
type RouterError ¶
RouterError is a custom error type for the router.
func NewError ¶
func NewError(code int, msg ...string) RouterError
func (RouterError) Error ¶
func (e RouterError) Error() string
func (RouterError) IsCode ¶
func (e RouterError) IsCode(errCode ...int) bool
Check if the error code matches the specified error code.
func (RouterError) String ¶
func (e RouterError) String() string
Click to show internal directories.
Click to hide internal directories.