errors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlreadyExists

func AlreadyExists(msg string, tags ...Tag) error

AlreadyExists ...

func Canceled

func Canceled(msg string, tags ...Tag) error

Canceled ...

func Combine

func Combine(errs ...error) error

Combine combines multiple errors together into a same error.

func DeadlineExceeded

func DeadlineExceeded(msg string, tags ...Tag) error

DeadlineExceeded ...

func Internal

func Internal(msg string, err error, tags ...Tag) error

Internal ...

func InvalidArgument

func InvalidArgument(msg string, tags ...Tag) error

InvalidArgument ...

func New

func New(msg string) error

New creates a new internal error

func Newf

func Newf(f string, args ...interface{}) error

Newf creates a new internal error with a message format

func NotFound

func NotFound(msg string, tags ...Tag) error

NotFound ...

func PermissionDenied

func PermissionDenied(msg string, tags ...Tag) error

PermissionDenied ...

func ResourceExhausted

func ResourceExhausted(msg string, tags ...Tag) error

ResourceExhausted ...

func Unauthenticated

func Unauthenticated(msg string, tags ...Tag) error

Unauthenticated ...

func Unavailable

func Unavailable(msg string, tags ...Tag) error

Unavailable ...

func Unimplemented

func Unimplemented(msg string, tags ...Tag) error

Unimplemented ...

Types

type Error

type Error struct {
	Target  string `json:"target"`  // The error target, with the line of code
	Reason  string `json:"reason"`  // The error reason
	Message string `json:"message"` // The error message
	// contains filtered or unexported fields
}

Error represents an error with context.

func (*Error) Error

func (r *Error) Error() string

Error ...

func (*Error) GRPC

func (r *Error) GRPC() codes.Code

GRPC returns a GRPC status code.

func (*Error) HTTP

func (r *Error) HTTP() int

HTTP returns a HTTP status code.

func (*Error) RPCError

func (r *Error) RPCError() error

RPCError used for encoding server errors

type Tag

type Tag interface {
	Key() string
	Value() interface{}
}

Tag describe the minimum behaviour a tag should have - i.e. a key value pair.

func WithCategory

func WithCategory(key string, value interface{}) Tag

WithCategory represents a category to which will be transformed into a datadog stats tag.

func WithTag

func WithTag(key string, value interface{}) Tag

WithTag this generates a custom tag which is a simple key value pair.

Jump to

Keyboard shortcuts

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