mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
Reformat comments
This commit is contained in:
@@ -2,8 +2,7 @@ package errors
|
||||
|
||||
import "fmt"
|
||||
|
||||
// fatalError is an error that should be printed to the user, then the program
|
||||
// should exit with an error code.
|
||||
// fatalError is an error that should be printed to the user, then the program should exit with an error code.
|
||||
type fatalError string
|
||||
|
||||
func (e fatalError) Error() string {
|
||||
@@ -14,14 +13,12 @@ func (e fatalError) Fatal() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Fataler is an error which should be printed to the user directly.
|
||||
// Afterwards, the program should exit with an error.
|
||||
// Fataler is an error which should be printed to the user directly. Afterwards, the program should exit with an error.
|
||||
type Fataler interface {
|
||||
Fatal() bool
|
||||
}
|
||||
|
||||
// IsFatal returns true if err is a fatal message that should be printed to the
|
||||
// user. Then, the program should exit.
|
||||
// IsFatal returns true if err is a fatal message that should be printed to the user. Then, the program should exit.
|
||||
func IsFatal(err error) bool {
|
||||
e, ok := err.(Fataler)
|
||||
return ok && e.Fatal()
|
||||
|
||||
@@ -7,14 +7,13 @@ func Cause(err error) error {
|
||||
return errors.Cause(err)
|
||||
}
|
||||
|
||||
// New creates a new error based on message. Wrapped so that this package does
|
||||
// not appear in the stack trace.
|
||||
// New creates a new error based on message. Wrapped so that this package does not appear in the stack trace.
|
||||
var New = errors.New
|
||||
|
||||
// Errorf creates an error based on a format string and values. Wrapped so that
|
||||
// this package does not appear in the stack trace.
|
||||
// Errorf creates an error based on a format string and values. Wrapped so that this package does not appear in the
|
||||
// stack trace.
|
||||
var Errorf = errors.Errorf
|
||||
|
||||
// Wrap wraps an error retrieved from outside of restic. Wrapped so that this
|
||||
// package does not appear in the stack trace.
|
||||
// Wrap wraps an error retrieved from outside of restic. Wrapped so that this package does not appear in the stack
|
||||
// trace.
|
||||
var Wrap = errors.Wrap
|
||||
|
||||
Reference in New Issue
Block a user