errs

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeDuplicateStream = 1001
	CodeStreamNotExist  = 1002
	CodeUnknown         = 9999
	CodeConnectURL      = 2001
	CodeContextDone     = 1
)
View Source
const (
	Success = "success"
)

Variables

View Source
var (
	ErrDuplicateStream = New(CodeDuplicateStream, "duplicate stream")
	ErrStreamNotExist  = New(CodeStreamNotExist, "stream not exist")
	ErrConnectURL      = New(CodeConnectURL, "connect url error")
	ErrContextDone     = New(CodeContextDone, "context done")
)

Functions

func Code

func Code(e error) int32

func Msg

func Msg(e error) string

func New

func New(code int32, msg string) error

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Types

type Error

type Error struct {
	Code int32
	Msg  string
}

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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