Documentation ¶
Overview ¶
Package errors provides a way to return detailed information for an RPC request error. The error is normally JSON encoded.
Index ¶
- Variables
- func BadGateway(id, format string, a ...interface{}) error
- func BadRequest(id, format string, a ...interface{}) error
- func Conflict(id, format string, a ...interface{}) error
- func Equal(err1 error, err2 error) bool
- func Forbidden(id, format string, a ...interface{}) error
- func GatewayTimeout(id, format string, a ...interface{}) error
- func InternalServerError(id, format string, a ...interface{}) error
- func MethodNotAllowed(id, format string, a ...interface{}) error
- func New(id, detail string, code int32) error
- func NotFound(id, format string, a ...interface{}) error
- func NotImplemented(id, format string, a ...interface{}) error
- func ServiceUnavailable(id, format string, a ...interface{}) error
- func Timeout(id, format string, a ...interface{}) error
- func Unauthorized(id, format string, a ...interface{}) error
- type Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBadRequest ErrBadRequest = &Error{Code: 400} ErrUnauthorized = &Error{Code: 401} // ErrForbidden ErrForbidden = &Error{Code: 403} // ErrNotFound ErrNotFound = &Error{Code: 404} // ErrMethodNotAllowed ErrMethodNotAllowed = &Error{Code: 405} // ErrTimeout ErrTimeout = &Error{Code: 408} // ErrConflict ErrConflict = &Error{Code: 409} // ErrInternalServerError ErrInternalServerError = &Error{Code: 500} // ErNotImplemented ErNotImplemented = &Error{Code: 501} // ErrBadGateway ErrBadGateway = &Error{Code: 502} ErrServiceUnavailable = &Error{Code: 503} // ErrGatewayTimeout ErrGatewayTimeout = &Error{Code: 504} )
Functions ¶
func BadGateway ¶
BadGateway generates a 502 error
func BadRequest ¶
BadRequest generates a 400 error.
func GatewayTimeout ¶
GatewayTimeout generates a 504 error
func InternalServerError ¶
InternalServerError generates a 500 error.
func MethodNotAllowed ¶
MethodNotAllowed generates a 405 error.
func NotImplemented ¶
NotImplemented generates a 501 error
func ServiceUnavailable ¶
ServiceUnavailable generates a 503 error
func Unauthorized ¶
Unauthorized generates a 401 error.
Types ¶
Click to show internal directories.
Click to hide internal directories.