errx

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCCodeFromStatus added in v0.0.13

func GRPCCodeFromStatus(status int) codes.Code

func HTTPStatusFromCode added in v0.0.13

func HTTPStatusFromCode(code codes.Code) int

func NotEmpty added in v0.0.12

func NotEmpty(err error, skips ...int) bool

func SetNotEmptyExit added in v0.0.12

func SetNotEmptyExit(t bool)

func SetTrack added in v0.0.12

func SetTrack(t bool)

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func BadRequest

func BadRequest(format string, a ...interface{}) *Error

func Conflict

func Conflict(format string, a ...interface{}) *Error

func Forbidden

func Forbidden(format string, a ...interface{}) *Error

func FromError added in v0.0.13

func FromError(err error) *Error

func Internal added in v0.0.13

func Internal(format string, a ...interface{}) *Error

func New

func New(status int, format string, a ...interface{}) *Error

func NotFound

func NotFound(format string, a ...interface{}) *Error

func NotImplemented added in v0.0.13

func NotImplemented(format string, a ...interface{}) *Error

func OK

func OK(format string, a ...interface{}) *Error

func Unauthorized

func Unauthorized(format string, a ...interface{}) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) GRPCStatus added in v0.0.13

func (e *Error) GRPCStatus() *status.Status

func (*Error) GetMetadata added in v0.0.13

func (e *Error) GetMetadata(key string) interface{}

func (*Error) MarshalJSON added in v0.0.13

func (e *Error) MarshalJSON() ([]byte, error)

func (*Error) Message

func (e *Error) Message() string

func (*Error) Metadata added in v0.0.13

func (e *Error) Metadata() Metadata

func (*Error) Status

func (e *Error) Status() int

func (Error) WithMetadata added in v0.0.13

func (e Error) WithMetadata(md Metadata) *Error

type GRPCError added in v0.0.13

type GRPCError interface {
	GRPCStatus() *status.Status
}

type Metadata added in v0.0.13

type Metadata map[string]interface{}

Jump to

Keyboard shortcuts

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