errors

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(k Kind, description string) error
Example
var err error
x, y := 1, 2
if x != y {
	err = New(APPERRMET001, "something went wrong")
}
fmt.Println(err)
Output:

[APPERRMET001]: something went wrong

func NewWithError

func NewWithError(k Kind, err error) error

Types

type Error

type Error struct {
	// Kind is the class of error, such as permission failure, or "Other" if its
	// class is unknown or irrelevant.
	Kind Kind

	// The underlying error that triggered this one, if any.
	Err error
}

Error is the type that implements the error interface.

func (Error) Error

func (e Error) Error() string

Error implements error.

type Kind

type Kind uint8

Kind defines the kind of error this is.

const (
	GENERR001 Kind = iota // The Message Body is not in the expected format, for example mandatory fields are missing.
	GENERR002             // The provided messageType is not supported.
	GENERR003             // The expiration date of the Message had passed at the point at which delivery was attempted.
	GENERR004             // Invalid, missing or corrupt headers were detected on the Message.
	GENERR005             // Maximum number of connection retries exceeded when attempting to send the Message.
	GENERR006             // An error occurred interacting with the underlying system.
	GENERR007             // Malformed JSON was detected in the Message Body.
	GENERR008             // An attempt to roll back a transaction failed.
	GENERR009             // An unexpected or unknown error occurred.
	GENERR010             // Maximum number of Message resend retries exceeded.

	// Metadata Error Codes
	APPERRMET001 // Received a Metadata UPDATE with a datasetUUID that does not exist.
	APPERRMET002 // Received a Metadata DELETE with a datasetUUID that does not exist.
	APPERRMET003 // Received a Metadata READ with a datasetUUID that does not exist.
	APPERRMET004 // Received an invalid checksum for a file provided within the payload.
)

Kinds of errors.

func (Kind) String

func (k Kind) String() (ret string)

String implements Stringer.

Jump to

Keyboard shortcuts

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