fail

package
v0.0.0-...-d8e89f0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEqual

func IsEqual(err, other error) bool

IsEqual tests whether an error is equal to another error / failure

func IsFail

func IsFail(err error) bool

IsFail tests whether the passed in error is a failure

func New

func New(message string, data interface{}) error

New creates a new failure

func NewFromErr

func NewFromErr(err error, data interface{}) error

NewFromErr returns a new failure based on the passed in error

Types

type Fail

type Fail struct {
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

Fail is an error whos contents can be exposed to the client and is usually the result of incorrect client input

func (*Fail) Error

func (f *Fail) Error() string

Jump to

Keyboard shortcuts

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