errors

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrUnknown indicates an unknown error.
	Unknown = New(codes.Unknown, codes.Unknown.String())

	// ErrInvalidArgument indicates missing or malformed field in a request.
	InvalidArgument = New(codes.InvalidArgument, codes.InvalidArgument.String())

	// ErrNotFound indicates that the requested resource does not exist.
	NotFound = New(codes.NotFound, codes.NotFound.String())

	// ErrAlreadyExists indicates that the request to be created already exits.
	AlreadyExists = New(codes.AlreadyExists, codes.AlreadyExists.String())

	// ErrUnimplemented indicates the requested service has not been implemented.
	Unimplemented = New(codes.Unimplemented, codes.Unimplemented.String())
)

Functions

func Errorf

func Errorf(code codes.Code, format string, a ...interface{}) error

Errorf creates an error from the code and a format specifier.

func New

func New(code codes.Code, msg string) error

New creates an error from the code and the message.

func Wrap

func Wrap(e error, msg string) error

Wrap returns an error wrapped with the supplied message. If the given error is nil, Wrap returns nil.

func Wrapf

func Wrapf(e error, format string, a ...interface{}) error

Wrap returns an error wrapped with the format specifier. If the given error is nil, Wrap returns nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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