xerr

package
v0.0.0-...-953156a Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(err error) string

Types

type XCode

type XCode int
const (
	OK              XCode = 0
	Canceled        XCode = 1
	Unknown         XCode = 2
	InvalidArgument XCode = 3

	DeadlineExceeded XCode = 4

	NotFound XCode = 5

	AlreadyExists XCode = 6

	PermissionDenied XCode = 7

	ResourceExhausted XCode = 8

	FailedPrecondition XCode = 9

	Aborted XCode = 10

	OutOfRange XCode = 11

	Unimplemented XCode = 12

	Internal XCode = 13

	Unavailable XCode = 14

	DataLoss XCode = 15

	Unauthenticated XCode = 16
)

type XError

type XError struct {
	Code    XCode  `json:"code"`
	Message string `json:"message"`
	Where   string `json:"where"`
}

func FromXErr

func FromXErr(err error) *XError

func XErr

func XErr(code XCode, msg string, where ...bool) *XError

func (*XError) Error

func (p *XError) Error() string

Error() string

func (*XError) GRPCStatus

func (se *XError) GRPCStatus() *status.Status

func (*XError) String

func (p *XError) String() string

Error() string

type XStatus

type XStatus spb.Status

statusError is an alias of a status proto. It implements error and Status, and a nil statusError should never be returned by this package.

func (*XStatus) Error

func (se *XStatus) Error() string

func (*XStatus) GRPCStatus

func (se *XStatus) GRPCStatus() *XStatus

Jump to

Keyboard shortcuts

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