Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StatusCode ¶
StatusCode returns the HTTP status carried by err, or fallback when none is available.
Types ¶
type HTTPStatusError ¶
type HTTPStatusError struct {
// contains filtered or unexported fields
}
HTTPStatusError describes a failure with an HTTP status code.
func New ¶
func New(status int, msg string) *HTTPStatusError
New constructs an error with the given HTTP status and message.
func (*HTTPStatusError) Error ¶
func (e *HTTPStatusError) Error() string
func (*HTTPStatusError) StatusCode ¶
func (e *HTTPStatusError) StatusCode() int
type StatusCoder ¶
type StatusCoder interface {
StatusCode() int
}
StatusCoder is implemented by errors that carry an HTTP status code.
type StatusError ¶
type StatusError interface {
error
StatusCoder
}
StatusError is implemented by errors that carry an HTTP status code.
Click to show internal directories.
Click to hide internal directories.