Documentation ¶
Overview ¶
Package errors provides a way to return detailed information for an RPC request error. The error is normally JSON encoded.
Index ¶
- func BadGateway(format string, a ...interface{}) error
- func BadRequest(format string, a ...interface{}) error
- func Conflict(format string, a ...interface{}) error
- func Equal(err1 error, err2 error) bool
- func Forbidden(format string, a ...interface{}) error
- func GatewayTimeout(format string, a ...interface{}) error
- func InternalServerError(format string, a ...interface{}) error
- func MethodNotAllowed(format string, a ...interface{}) error
- func New(detail string, code int32) error
- func NotFound(format string, a ...interface{}) error
- func NotImplemented(format string, a ...interface{}) error
- func ServiceUnavailable(format string, a ...interface{}) error
- func Timeout(format string, a ...interface{}) error
- func Unauthorized(format string, a ...interface{}) error
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 ¶
type Error ¶
type Error struct { RequestId string `json:"request_id,omitempty"` Code int32 `json:"code,omitempty"` Detail string `json:"detail,omitempty"` Status string `json:"status,omitempty"` }
Click to show internal directories.
Click to hide internal directories.