coded

package
v0.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string

Code define provider defined stable code. Each provider has own code-registry, but we have global registry to dedup them in case we have duplicate we will panic at start

func All

func All() []Code

func Register

func Register(parts ...string) Code

func (Code) Contains

func (c Code) Contains(err error) bool

func (Code) ID

func (c Code) ID() string

type CodedError

type CodedError interface {
	error
	// Code is an uniq identifier of some specific error that can be referred from documentation or code / sdk.
	Code() Code
}

CodedError is an error with an attached code

func Errorf

func Errorf(code Code, format string, a ...any) CodedError

CategorizedErrorf produces a xerrors-wrapped error with a given assigned category

Jump to

Keyboard shortcuts

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