errors

package
v0.0.0-...-9a529fd Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2017 License: MIT Imports: 3 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Nature    Nature    // Kind of error, used a comparator
	Timestamp time.Time // The moment the error was created
	Fault     error     // The source of the failure
}

Failure states for fault that occurs during a process.

func New

func New(nat Nature, src interface{}) Failure

NewFailure creates a new Failure from a source error

func (Failure) Error

func (err Failure) Error() string

Error implements the error built-in interface

type Nature

type Nature string
const (
	Structural     Nature = "Invalid structure"        // Requests, parameters or inputs are wrong. Retry won't work.
	NotFound       Nature = "Unable to find entity"    // Failed to lookup something, somewhere
	Behavioural    Nature = "Wrong behavior or result" // No error but the result isn't the one expected
	Operational    Nature = "Invalid operation"        // An operation failed due to external causes, a retry could work
	Implementation Nature = "Illegal call"             // Method not implemented or unsupported for the given structure
)

Jump to

Keyboard shortcuts

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