koierr

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewErrSuccess        = func(err error) *KoiError { return NewKoiError(0, "success", err) }
	NewErrUnknown        = func(err error) *KoiError { return NewKoiError(1, "unknown error", err) }
	NewErrBadRequest     = func(err error) *KoiError { return NewKoiError(400, "bad request", err) }
	NewErrInternalError  = func(err error) *KoiError { return NewKoiError(500, "internal error", err) }
	NewErrNotImplemented = func(err error) *KoiError { return NewKoiError(501, "not implemented", err) }

	ErrSuccess        = NewErrSuccess(nil)
	ErrUnknown        = NewErrUnknown(nil)
	ErrBadRequest     = NewErrBadRequest(nil)
	ErrInternalError  = NewErrInternalError(nil)
	ErrNotImplemented = NewErrNotImplemented(nil)

	NewErrInstanceExists = func(name string) *KoiError {
		return NewKoiError(1100, fmt.Sprintf("instance %s already exists", name), nil)
	}
)

Functions

This section is empty.

Types

type KoiError

type KoiError struct {
	Code uint16
	Msg  string
	Err  error
}

func NewKoiError

func NewKoiError(code uint16, msg string, err error) *KoiError

func (*KoiError) Error

func (e *KoiError) Error() string

func (*KoiError) Unwrap

func (e *KoiError) Unwrap() error

Jump to

Keyboard shortcuts

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