Documentation ¶
Index ¶
- Constants
- func IsReason(err error, targets ...Reason) bool
- func NewDebugInfo(stacks []string, msg string) *errdetails.DebugInfo
- func NewLocalizedMsg(ctx context.Context, msg Message) *errdetails.LocalizedMessage
- func NewLocalizedMsgWithLang(languages []string, msg Message) *errdetails.LocalizedMessage
- func NewReason(reason Reason, meta map[string]string) *errdetails.ErrorInfo
- type Error
- func Errorf(code code.Code, msg string, details ...proto.Message) *Error
- func FromError(err error) *Error
- func FromErrorCode(err error, code2 code.Code) *Error
- func FromProto(stu *status.Status) *Error
- func New(code code.Code, err error, details ...proto.Message) *Error
- func WithMessage(err error, ctx context.Context, msg Message) *Error
- func WithReason(err error, reason Reason, metadata map[string]string) *Error
- func (e *Error) Code() int32
- func (e *Error) Error() string
- func (e *Error) GRPCStatus() *status.Status
- func (e *Error) HttpCode() int32
- func (e *Error) Message() string
- func (e *Error) Reason() *errdetails.ErrorInfo
- func (e *Error) Stacks() []string
- func (e *Error) WithDetails(details ...proto.Message)
- func (e *Error) WithStack()
- type Message
- type Reason
Constants ¶
View Source
const (
// The operation was cancelled, typically by the caller.
StatusClientClosed = 499
)
Variables ¶
This section is empty.
Functions ¶
func NewDebugInfo ¶
func NewDebugInfo(stacks []string, msg string) *errdetails.DebugInfo
func NewLocalizedMsg ¶
func NewLocalizedMsg(ctx context.Context, msg Message) *errdetails.LocalizedMessage
func NewLocalizedMsgWithLang ¶
func NewLocalizedMsgWithLang(languages []string, msg Message) *errdetails.LocalizedMessage
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func WithMessage ¶ added in v0.1.2
func WithReason ¶ added in v0.1.2
func (*Error) GRPCStatus ¶
func (*Error) Reason ¶ added in v0.1.2
func (e *Error) Reason() *errdetails.ErrorInfo
func (*Error) WithDetails ¶
Click to show internal directories.
Click to hide internal directories.