e

package
v0.0.0-...-aba326a Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package e provides error types and handling. Patterns are inspired by the following article: https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFull

func ErrFull(err error) error

ErrFull wraps an error such that it will fulfill IsFull.

func ErrInvalid

func ErrInvalid(err error) error

ErrInvalid wraps an error such that it will fulfill IsInvalid.

func ErrNotFound

func ErrNotFound(err error) error

ErrNotFound wraps an error such that it will fulfill IsNotFound.

func GRPC

func GRPC(err error) error

GRPC annotates an error with the appropriate gRPC status code based on the error interfaces it fulfills.

func IsFull

func IsFull(err error) bool

IsFull determines whether an error indicates something was full. It does this by walking down the stack of errors built by pkg/errors and returning true for the first error that implements the following interface:

type fuller interface {
  Full()
}

func IsInvalid

func IsInvalid(err error) bool

IsInvalid determines whether an error indicates an input was invalid. It does this by walking down the stack of errors built by pkg/errors and returning true for the first error that implements the following interface:

type invalider interface {
  Invalid()
}

func IsNotFound

func IsNotFound(err error) bool

IsNotFound determines whether an error indicates something was not found. It does this by walking down the stack of errors built by pkg/errors and returning true for the first error that implements the following interface:

type notfounder interface {
  NotFound()
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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