Documentation ¶
Overview ¶
Package errors provides a way to return detailed information for an RPC request error. The error is normally JSON encoded.
Index ¶
- func BadRequest(id, format string, a ...interface{}) error
- func Conflict(id, format string, a ...interface{}) error
- func Forbidden(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 Timeout(id, format string, a ...interface{}) error
- func Unauthorized(id, format string, a ...interface{}) error
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest generates a 400 error.
func InternalServerError ¶
InternalServerError generates a 500 error.
func MethodNotAllowed ¶ added in v0.15.0
MethodNotAllowed generates a 405 error.
func Unauthorized ¶
Unauthorized generates a 401 error.
Types ¶
type Error ¶
type Error struct { Id string `json:"id"` Code int32 `json:"code"` Detail string `json:"detail"` Status string `json:"status"` }
Error implements the error interface.
Click to show internal directories.
Click to hide internal directories.