emperror

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2017 License: MIT Imports: 3 Imported by: 89

README

Emperror

Build Status Go Report Card GoDoc

The Emperor takes care of all errors personally.

Development

The project requires Glide to install dependencies.

$ make dep

When all coding and testing is done, please run the test suite:

$ make check

License

The MIT License (MIT). Please see License File for more information.

Documentation

Overview

Package emperror provides error handling solutions to applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleIfErr added in v0.1.1

func HandleIfErr(handler errors.Handler, err error)

HandleIfErr handles an error whenever it occures.

func HandleRecover added in v0.1.1

func HandleRecover(handler errors.Handler)

HandleRecover recovers from a panic and handles the error.

go emperror.HandleRecover(errorHandler)

func NewCompositeHandler

func NewCompositeHandler(handlers ...errors.Handler) errors.Handler

NewCompositeHandler returns a new compositeHandler.

func NewLogHandler

func NewLogHandler(l logger) errors.Handler

NewLogHandler returns a new logHandler.

func NewNullHandler

func NewNullHandler() errors.Handler

NewNullHandler returns a new nullHandler.

Types

type TestHandler

type TestHandler struct {
	// contains filtered or unexported fields
}

TestHandler throws every error away.

func NewTestHandler

func NewTestHandler() *TestHandler

NewTestHandler returns a new TestHandler.

func (*TestHandler) Errors

func (h *TestHandler) Errors() []error

Errors returns all the handled errors.

func (*TestHandler) Handle

func (h *TestHandler) Handle(err error)

Handle saves the error in a list.

func (*TestHandler) Last

func (h *TestHandler) Last() error

Last returns the last handled error.

Directories

Path Synopsis
Package airbrake provides Airbrake integration.
Package airbrake provides Airbrake integration.
Package bugsnag provides Bugsnag integration.
Package bugsnag provides Bugsnag integration.
errors
Package errors extends the errors package in the stdlib.
Package errors extends the errors package in the stdlib.
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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