derrors

package
v0.0.0-...-3b01625 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package derrors defines internal error values to categorize the different types error semantics we support.

Index

Constants

This section is empty.

Variables

View Source
var (
	// NotFound indicates that a requested entity was not found (HTTP 404).
	NotFound = errors.New("not found")

	// InvalidArgument indicates that the input into the request is invalid in
	// some way (HTTP 400).
	InvalidArgument = errors.New("invalid argument")
)

Functions

func Wrap

func Wrap(errp *error, format string, args ...interface{})

Wrap adds context to the error and allows unwrapping the result to recover the original error.

Example:

defer derrors.Wrap(&err, "copy(%s, %s)", src, dst)

See Add for an equivalent function that does not allow the result to be unwrapped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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