commonerrors

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 1 Imported by: 1

README

commonerrors - tags for common causes of errors

GoDoc report card

Install:

go get github.com/muir/commonerrors

Idea

Commonerrors is a collection of error tags.

It offers:

  • UsageError
  • EnvironmentError
  • ConfigurationError
  • ProgrammerError
  • LibraryError

Basis

Right now, this package is based on github.com/pkg/errors. That package's support of WithStack is a bit broken so the base error package could change in the future.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurationError

func ConfigurationError(err error) error

ConfigurationError annotates an error as being a configuration error (messed up flags/command invocation). When you have a configuration error, you should display the program configuration help text.

func EnvironmentError

func EnvironmentError(err error) error

EnvironmentError annotates an error as being caused by an invalid environment variable. When you have an environment error, you may want to display appropriate help.

func IsConfigurationError

func IsConfigurationError(err error) bool

func IsEnvironmentError

func IsEnvironmentError(err error) bool

func IsLibraryError

func IsLibraryError(err error) bool

func IsProgrammerError

func IsProgrammerError(err error) bool

func IsUsageError

func IsUsageError(err error) bool

func IsValidationError

func IsValidationError(err error) bool

func LibraryError

func LibraryError(err error) error

LibraryError annotates an error as being caused by a bug in an imported library. Library authors should annotate errors that shouldn't happen this way. If you see such an error, please submit a fix or at least raise an issue.

func ProgrammerError

func ProgrammerError(err error) error

ProgrammerError annotates an error as being made by a user (importer) or a published package.

func UsageError

func UsageError(err error) error

UsageError annotates an error as being a usage error (messed up flags/command invocation). When you have a usage error, you should display the program usage help text.

func ValidationError

func ValidationError(err error) error

ValidationError annotates an error as being caused by an invalid value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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