errors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides an Error interface that includes the component name with the underlying error.

Index

Constants

View Source
const DefaultComp = "web test launcher"

DefaultComp is the default component name used when no other component specified.

Variables

This section is empty.

Functions

func Component

func Component(err error) string

Component returns err.Component() if err implements it, otherwise it returns DefaultComp. Component is intended for grouping error messages by source.

func IsPermanent

func IsPermanent(err error) bool

IsPermanent returns err.Permanent() if err implements it, otherwise it returns false. IsPermanent is intended for preventing retries when errors occur that are unlikely to go away.

func New

func New(component string, err interface{}) error

New returns an error, e, such that:

Permanent(e) is false
If Component(err) is not DefaultComp, Component(e) is Component(err)
Else If component is "", Component(e) is DefaultComp
Else Component(e) is component.

func NewPermanent

func NewPermanent(component string, err interface{}) error

NewPermanent returns an error, e, such that:

Permanent(e) is true
If Component(err) is not DefaultComp, Component(e) is Component(err)
Else If component is "", Component(e) is DefaultComp
Else Component(e) is component.

Types

This section is empty.

Jump to

Keyboard shortcuts

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