errorlib

package module
v0.0.0-...-1db943d Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2018 License: MIT Imports: 5 Imported by: 98

README

Errorlib

Documentation Build Status Report Card

About

Go (golang) library which provides convenience functions for dealing with errors.

Example use case:

Merging a slice of potential errors into either nil or a single concatenated error.

Created by Jay Taylor and used by Gigawatt.

Requirements
  • Go version 1.1 or newer
Running the test suite
go test ./...
License

Permissive MIT license, see the LICENSE file for more information.

See also:

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotRunningError     = errors.New("not running")
	AlreadyRunningError = errors.New("already running")
	NotFoundError       = errors.New("not found")
	NotAuthorizedError  = errors.New("not authorized")
)

Functions

func Error

func Error(detail interface{}) error

Errorf constructs informative errors which include helpful contextual information.

func ErrorExit

func ErrorExit(reason error, statusCode int)

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf is just like `Error` with the addition of string formatting.

func Merge

func Merge(errs []error) error

Merge merges a slice of errors into a single error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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