apierr

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists = errors.New("already exists")
View Source
var ErrBadRequest = errors.New("bad request")
View Source
var ErrFailedToGenerateCredentials = errors.New("failed to generate credentials")
View Source
var ErrForbidden = errors.New("forbidden")
View Source
var ErrInvalidFile = errors.New("invalid file")
View Source
var ErrInvalidPassword = errors.New("invalid password")
View Source
var ErrInvalidRequest = errors.New("invalid request")
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrUnauthenticated = errors.New("unauthenticated")
View Source
var ErrUnexpected = errors.New("unexpected")
View Source
var ErrValidationFailed = errors.New("validation failed")

Functions

func GRPCCode added in v0.1.6

func GRPCCode(err error) codes.Code

GRPCCode returns the gRPC status code for an error. Done in accordance with https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto

func HTTPStatusCode

func HTTPStatusCode(err error) int

HTTPStatusCode returns the HTTP status code for the given error

func StreamServerInterceptor added in v0.1.6

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new streaming server interceptor for error translation.

func UnaryServerInterceptor added in v0.1.6

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptor for error translation.

Types

type HandleErrFunc added in v0.1.6

type HandleErrFunc func(error) error

HandleErrFunc is a function that transforms the error in some way

type Option added in v0.1.6

type Option func(*options)

func WithErrTranslation added in v0.1.6

func WithErrTranslation(f HandleErrFunc) Option

Jump to

Keyboard shortcuts

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