foxerr

package
v0.0.0-...-506c09b Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const NotFoxError = 0

Variables

This section is empty.

Functions

func Code

func Code(err error) int

func IsFoxError

func IsFoxError(err error) bool

func MatchCode

func MatchCode(err error, code int) bool

func StatusCode

func StatusCode(err error) int

Types

type Error

type Error interface {
	// Satisfy the generic error interface.
	error

	// return the error defined by fox.ONE
	Code() int

	// return the error detail msg
	Message() string
}

func New

func New(code int, message ...string) Error

type RequestFailure

type RequestFailure interface {
	Error

	// The status code of the HTTP response.
	StatusCode() int
}

func NewRequestFailure

func NewRequestFailure(err Error, statusCode int) RequestFailure

Jump to

Keyboard shortcuts

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