errors

package
v0.0.0-...-0265167 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package errors provides custom error types used within restic.

Index

Constants

This section is empty.

Variables

View Source
var Errorf = errors.Errorf

Errorf creates an error based on a format string and values. Wrapped so that this package does not appear in the stack trace.

View Source
var New = errors.New

New creates a new error based on message. Wrapped so that this package does not appear in the stack trace.

View Source
var WithStack = errors.WithStack

WithStack annotates err with a stack trace at the point WithStack was called. If err is nil, WithStack returns nil.

View Source
var Wrap = errors.Wrap

Wrap wraps an error retrieved from outside of restic. Wrapped so that this package does not appear in the stack trace.

View Source
var Wrapf = errors.Wrapf

Wrapf returns an error annotating err with the format specifier. If err is nil, Wrapf returns nil.

Functions

func As

func As(err error, tgt interface{}) bool

As finds the first error in err's tree that matches target, and if one is found, sets target to that error value and returns true. Otherwise, it returns false.

func CombineErrors

func CombineErrors(errors ...error) (err error)

CombineErrors combines multiple errors into a single error after filtering out any nil values. If no errors are passed, it returns nil. If one error is passed, it simply returns that same error.

func Fatal

func Fatal(s string) error

Fatal returns an error that is marked fatal.

func Fatalf

func Fatalf(s string, data ...interface{}) error

Fatalf returns an error that is marked fatal.

func Is

func Is(x, y error) bool

Is reports whether any error in err's tree matches target.

func IsFatal

func IsFatal(err error) bool

IsFatal returns true if err is a fatal message that should be printed to the user. Then, the program should exit.

func Unwrap

func Unwrap(err error) error

Unwrap returns the result of calling the Unwrap method on err, if err's type contains an Unwrap method returning error. Otherwise, Unwrap returns nil.

Unwrap only calls a method of the form "Unwrap() error". In particular Unwrap does not unwrap errors returned by [Join].

Types

This section is empty.

Jump to

Keyboard shortcuts

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