errors

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Success 0
	Success = 0

	// UnknownError 1000-2000
	UnknownError = -1
	AuthError    = 1000
	ParamsError  = 1001
	RequestError = 1002
	// DbError 2000-3000
	DbError = 2

	PluginError = 3000
)

Variables

View Source
var Overlap = func(o *options) {
	o.overlap = true
}

Overlap sets the overlap option

Functions

func IsCode

func IsCode(err error, code int) bool

IsCode returns true if the error has the given code

func New

func New(code int, e interface{}, opts ...optionFunc) error

New creates a new error with the given code, message and options

Types

type Code

type Code int

Code is the error code

const (
	// ErrCodeNone is the code for no error
	ErrCodeNone Code = iota

	// ErrCodeBadArgument is the code for bad argument
	ErrCodeBadArgument

	// ErrCodeNotImplemented is the code for not implemented
	ErrCodeNotImplemented
)

type Error

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

Error is the error type

func (*Error) Code

func (e *Error) Code() int

func (*Error) Error

func (e *Error) Error() string

func (*Error) String

func (e *Error) String() string

Jump to

Keyboard shortcuts

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