Documentation ¶
Index ¶
- func BadGateway(id, format string, a ...interface{}) error
- func BadRequest(id, format string, a ...interface{}) error
- func CodeFromHTTPStatus(status int) codes.Code
- func Conflict(id, format string, a ...interface{}) error
- func Equal(err1 error, err2 error) bool
- func Forbidden(id, format string, a ...interface{}) error
- func FromGRPC(er error) error
- func GatewayTimeout(id, format string, a ...interface{}) error
- func InternalServerError(id, format string, a ...interface{}) error
- func IsContextCanceled(err error) bool
- func IsNetworkError(err error) bool
- 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 ToGRPC(er error) error
- func Unauthorized(id, 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 CodeFromHTTPStatus ¶ added in v4.0.7
CodeFromHTTPStatus converts an HTTP response status into the corresponding gRPC error code.
func GatewayTimeout ¶
GatewayTimeout generates a 504 error
func InternalServerError ¶
InternalServerError generates a 500 error.
func IsContextCanceled ¶
IsContextCanceled interprets error as a "context canceled"
func IsNetworkError ¶
IsNetworkError tries to detect if error is a network 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.