errors

package
v0.0.0-...-801da37 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: Apache-2.0 Imports: 3 Imported by: 21

Documentation

Overview

Package errors provides the common infrastructure for managing errors. It is primarily a wrapper around github.com/pkg/errors package. See https://godoc.org/github.com/pkg/errors for usage instructions.

While it is possible for most packages to use this package without needing the underlying package it is wrapping, certain usecases (such as interacting with the recorded stack trace) cannot avoid leakage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

Cause returns the underlying cause of the error, if possible. See https://godoc.org/github.com/pkg/errors#Cause for further details.

func Errorf

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

Errorf formats according to a format specifier and returns the string as a value that satisfies error. See https://godoc.org/github.com/pkg/errors#Errorf for further details

func New

func New(message string) error

New returns an error with the supplied message. See https://godoc.org/github.com/pkg/errors#New for further details

func ReportToSentry

func ReportToSentry(err error, r *http.Request)

ReportToSentry reports err to the configured sentry server. Optionally, specifying a non-nil `r` will include information in the report about the current http request.

func Wrap

func Wrap(err error, message string) error

Wrap returns an error annotating err with message. If err is nil, Wrap returns nil. See https://godoc.org/github.com/pkg/errors#Wrap for more details.

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Wrapf returns an error annotating err with the format specifier. If err is nil, Wrapf returns nil. See https://godoc.org/github.com/pkg/errors#Wrapf for more details.

Types

type StackTracer

type StackTracer interface {
	StackTrace() errors.StackTrace
}

StackTracer represents a type (usually an error) that can provide a stack trace.

Jump to

Keyboard shortcuts

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