customError

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

Cause get cause error

func Wrap

func Wrap(err error, args ...string) error

Wrap custom error wrap without flag example result : <args> : <err>

func WrapFlag

func WrapFlag(err error, flag string, args ...string) error

WrapFlag custom error wrap with flag example result : [<flag>] <args> : <err>

Types

type Error

type Error struct {
	HttpCode int
	GrpcCode codes.Code
	Err      error
}

func New

func New(err error) *Error

func (*Error) SetGrpcCode

func (e *Error) SetGrpcCode(grpcCode codes.Code) *Error

func (*Error) SetHttpCode

func (e *Error) SetHttpCode(httpCode int) *Error

func (*Error) Wrap

func (e *Error) Wrap(args ...string) *Error

func (*Error) WrapFlag

func (e *Error) WrapFlag(flag string, args ...string) *Error

Jump to

Keyboard shortcuts

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