errors

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: BSD-2-Clause Imports: 4 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 WithMessage = errors.WithMessage

WithMessage annotates err with a new message. If err is nil, WithMessage returns nil.

View Source
var WithStack = errors.WithStack
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 Cause

func Cause(err error) error

Cause returns the cause of an error. It will also unwrap certain errors, e.g. *url.Error returned by the net/http client.

func Fatal

func Fatal(s string) error

Fatal returns a wrapped error which implements the Fataler interface.

func Fatalf

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

Fatalf returns an error which implements the Fataler interface.

func Is added in v0.12.0

func Is(x, y error) bool

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.

Types

type Fataler

type Fataler interface {
	Fatal() bool
}

Fataler is an error which should be printed to the user directly. Afterwards, the program should exit with an error.

Jump to

Keyboard shortcuts

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