Documentation
¶
Index ¶
- Variables
- func ErrorText(code int) string
- func HandleError(w http.ResponseWriter, r *http.Request, err error)
- func HandleMiddlewareError(w http.ResponseWriter, r *http.Request, err error, next http.Handler)
- func MethodNotAllowed(method string, allowed ...string) web.Error
- func New(s string, args ...interface{}) error
- func NewError(code int, headers http.Header, body []byte) error
- type BadRequestError
- func (err *BadRequestError) AppendError(e error)
- func (err *BadRequestError) AppendErrorString(s string)
- func (err *BadRequestError) AppendErrorf(s string, args ...interface{})
- func (err *BadRequestError) Error() string
- func (err *BadRequestError) Ok() bool
- func (err *BadRequestError) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (err *BadRequestError) Status() int
- func (err *BadRequestError) String() string
- type Frame
- type HandlerError
- type MethodNotAllowedError
- type PC
- type PanicError
- type RedirectError
- func (e RedirectError) Error() string
- func (e RedirectError) Location() string
- func (e *RedirectError) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (e RedirectError) Status() int
- func (e RedirectError) Temporary() bool
- func (e *RedirectError) TryServeHTTP(w http.ResponseWriter, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = &HandlerError{Code: http.StatusNotFound}
)
Functions ¶
func HandleError ¶
func HandleError(w http.ResponseWriter, r *http.Request, err error)
func HandleMiddlewareError ¶ added in v0.2.0
Types ¶
type BadRequestError ¶ added in v0.6.0
type BadRequestError struct {
Errors []error
}
func (*BadRequestError) AppendError ¶ added in v0.6.0
func (err *BadRequestError) AppendError(e error)
func (*BadRequestError) AppendErrorString ¶ added in v0.6.0
func (err *BadRequestError) AppendErrorString(s string)
func (*BadRequestError) AppendErrorf ¶ added in v0.6.0
func (err *BadRequestError) AppendErrorf(s string, args ...interface{})
func (*BadRequestError) Error ¶ added in v0.6.0
func (err *BadRequestError) Error() string
func (*BadRequestError) Ok ¶ added in v0.6.0
func (err *BadRequestError) Ok() bool
func (*BadRequestError) ServeHTTP ¶ added in v0.6.0
func (err *BadRequestError) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*BadRequestError) Status ¶ added in v0.6.0
func (err *BadRequestError) Status() int
func (*BadRequestError) String ¶ added in v0.6.0
func (err *BadRequestError) String() string
type Frame ¶ added in v0.17.0
type Frame struct {
// contains filtered or unexported fields
}
Heavily based on github.com/pkg/errors.Frame
func (Frame) Format ¶ added in v0.17.0
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time GOPATH separated by \n\t (<funcname>\n\t<path>) %+n full package name followed by function name %+v equivalent to %+s:%d
type HandlerError ¶
Reference Handler error
func (HandlerError) Error ¶
func (err HandlerError) Error() string
func (HandlerError) ServeHTTP ¶
func (err HandlerError) ServeHTTP(w http.ResponseWriter, _ *http.Request)
func (HandlerError) Status ¶
func (err HandlerError) Status() int
func (HandlerError) String ¶
func (err HandlerError) String() string
func (HandlerError) Unwrap ¶
func (err HandlerError) Unwrap() error
type MethodNotAllowedError ¶ added in v0.3.0
func (*MethodNotAllowedError) Error ¶ added in v0.3.0
func (err *MethodNotAllowedError) Error() string
func (*MethodNotAllowedError) ServeHTTP ¶ added in v0.3.0
func (err *MethodNotAllowedError) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*MethodNotAllowedError) Status ¶ added in v0.3.0
func (err *MethodNotAllowedError) Status() int
func (*MethodNotAllowedError) TryServeHTTP ¶ added in v0.19.0
func (err *MethodNotAllowedError) TryServeHTTP(w http.ResponseWriter, r *http.Request) error
type PanicError ¶ added in v0.3.0
type PanicError struct {
// contains filtered or unexported fields
}
func Panic ¶ added in v0.3.0
func Panic(rvr interface{}) *PanicError
backtrace based on github.com/go-chi/middleware/recoverer
func Recover ¶ added in v0.4.0
func Recover() *PanicError
func (PanicError) Error ¶ added in v0.3.0
func (p PanicError) Error() string
func (PanicError) ServeHTTP ¶ added in v0.3.0
func (p PanicError) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (PanicError) Stack ¶ added in v0.3.0
func (p PanicError) Stack() []string
func (PanicError) Status ¶ added in v0.3.0
func (_ PanicError) Status() int
func (PanicError) String ¶ added in v0.3.0
func (p PanicError) String() string
func (PanicError) Unwrap ¶ added in v0.3.0
func (p PanicError) Unwrap() error
type RedirectError ¶ added in v0.15.0
type RedirectError struct {
// contains filtered or unexported fields
}
func NewMovedPermanently ¶ added in v0.15.0
func NewMovedPermanently(location string) *RedirectError
301
func NewPermanentRedirect ¶ added in v0.15.0
func NewPermanentRedirect(location string) *RedirectError
308
func NewTemporaryRedirect ¶ added in v0.15.0
func NewTemporaryRedirect(location string) *RedirectError
307
func (RedirectError) Error ¶ added in v0.15.0
func (e RedirectError) Error() string
func (RedirectError) Location ¶ added in v0.15.0
func (e RedirectError) Location() string
func (*RedirectError) ServeHTTP ¶ added in v0.15.0
func (e *RedirectError) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (RedirectError) Status ¶ added in v0.15.0
func (e RedirectError) Status() int
func (RedirectError) Temporary ¶ added in v0.15.0
func (e RedirectError) Temporary() bool
func (*RedirectError) TryServeHTTP ¶ added in v0.15.0
func (e *RedirectError) TryServeHTTP(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.