Documentation ¶
Overview ¶
Package errors contains helper functions for working with YARPC errors for encoding and transport implementations.
Index ¶
- func ExpectEncodings(req *transport.Request, want ...transport.Encoding) error
- func RequestBodyDecodeError(req *transport.Request, err error) error
- func RequestBodyEncodeError(req *transport.Request, err error) error
- func RequestHeadersDecodeError(req *transport.Request, err error) error
- func RequestHeadersEncodeError(req *transport.Request, err error) error
- func ResponseBodyDecodeError(req *transport.Request, err error) error
- func ResponseBodyEncodeError(req *transport.Request, err error) error
- func ResponseHeadersDecodeError(req *transport.Request, err error) error
- func ResponseHeadersEncodeError(req *transport.Request, err error) error
- func WrapHandlerError(err error, service string, procedure string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectEncodings ¶
ExpectEncodings verifies that the given request has one of the given encodings, otherwise it returns a YARPC error with code yarpcerrors.CodeInvalidArgument.
func RequestBodyDecodeError ¶
RequestBodyDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the request body.
func RequestBodyEncodeError ¶
RequestBodyEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the request body.
func RequestHeadersDecodeError ¶
RequestHeadersDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the request headers.
func RequestHeadersEncodeError ¶
RequestHeadersEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the request headers.
func ResponseBodyDecodeError ¶
ResponseBodyDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the response body.
func ResponseBodyEncodeError ¶
ResponseBodyEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the response body.
func ResponseHeadersDecodeError ¶
ResponseHeadersDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the response headers.
func ResponseHeadersEncodeError ¶
ResponseHeadersEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the response headers.
func WrapHandlerError ¶
WrapHandlerError is a convenience function to help wrap errors returned from a handler.
If err is nil, WrapHandlerError returns nil. If err is a YARPC error, WrapHandlerError returns err with no changes. If err is not a YARPC error, WrapHandlerError returns a new YARPC error with code yarpcerrors.CodeUnknown and message err.Error(), along with service and procedure information.
Types ¶
This section is empty.