failure

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID_ARGUMENT  = "INVALID_ARGUMENT"
	INVALID_OPERATION = "INVALID_OPERATION"
	UNKNOWN_ERROR     = "UNKNOWN_ERROR"
	NOP               = "NOP"
	NO_CONTENT        = "NO_CONTENT"
)

Variables

This section is empty.

Functions

func IsKnownErrorCode

func IsKnownErrorCode(message string) bool

func ThrowFailure

func ThrowFailure(err error)

func ThrowFailureMessage

func ThrowFailureMessage(message string, reason string)

Types

type Failure

type Failure struct {
	Message     string `json:"message"`
	Description string `json:"description"`
	Timestamp   int64  `json:"timestamp"`
	Err         error  `json:"-"`
}

func (*Failure) Error

func (f *Failure) Error() string

func (*Failure) MarshalJSON

func (f *Failure) MarshalJSON() ([]byte, error)

func (*Failure) Unwrap

func (f *Failure) Unwrap() error

Jump to

Keyboard shortcuts

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