errutil

package
v0.7.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errutil contains common application-level errors. They reside here to avoid cyclic dependencies.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRevisionForPackage = errors.New("no revision found for package name")
)

Analysis errors.

View Source
var (
	ErrNotImplemented = errors.New("not yet implemented")
)

General errors.

View Source
var (
	ErrRepositoryNotFound = errors.New("no repository found")
)

VCS errors.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string
	Fields  map[string]string
	Cause   error
}

Error is a custom application-level error primitive, that supports our particular use cases for user error message reporting.

func New

func New(message string) Error

New implements errors.New for Error.

func Wrap

func Wrap(err error, message string) Error

Wrap implements errors.Wrap for Error.

func (*Error) Error

func (e *Error) Error() string

Error implements error for Error.

func (*Error) Field

func (e *Error) Field(key, value string) *Error

func (*Error) Is

func (e *Error) Is(other Error) bool

Is defines comparison for error messages on the Message field. This is useful for comparing against sentinels, for the sake of providing more verbose and useful error messages when reporting to the user.

Jump to

Keyboard shortcuts

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