errors

package
v1.59.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 4 Imported by: 18

Documentation

Overview

Package errors contains helper functions for working with YARPC errors for encoding and transport implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectEncodings

func ExpectEncodings(req *transport.Request, want ...transport.Encoding) error

ExpectEncodings verifies that the given request has one of the given encodings, otherwise it returns a YARPC error with code yarpcerrors.CodeInvalidArgument.

func RequestBodyDecodeError

func RequestBodyDecodeError(req *transport.Request, err error) error

RequestBodyDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the request body.

func RequestBodyEncodeError

func RequestBodyEncodeError(req *transport.Request, err error) error

RequestBodyEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the request body.

func RequestHeadersDecodeError

func RequestHeadersDecodeError(req *transport.Request, err error) error

RequestHeadersDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the request headers.

func RequestHeadersEncodeError

func RequestHeadersEncodeError(req *transport.Request, err error) error

RequestHeadersEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the request headers.

func ResponseBodyDecodeError

func ResponseBodyDecodeError(req *transport.Request, err error) error

ResponseBodyDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the response body.

func ResponseBodyEncodeError

func ResponseBodyEncodeError(req *transport.Request, err error) error

ResponseBodyEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the response body.

func ResponseHeadersDecodeError

func ResponseHeadersDecodeError(req *transport.Request, err error) error

ResponseHeadersDecodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to decode the response headers.

func ResponseHeadersEncodeError

func ResponseHeadersEncodeError(req *transport.Request, err error) error

ResponseHeadersEncodeError builds a YARPC error with code yarpcerrors.CodeInvalidArgument that represents a failure to encode the response headers.

func WrapHandlerError

func WrapHandlerError(err error, service string, procedure string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL