github.com/advanderveer/restic@v0.8.1-0.20171209104529-42a8c19aaea6/internal/errors/wrap.go (about) 1 package errors 2 3 import "github.com/pkg/errors" 4 5 // Cause returns the cause of an error. 6 func Cause(err error) error { 7 return errors.Cause(err) 8 } 9 10 // New creates a new error based on message. Wrapped so that this package does 11 // not appear in the stack trace. 12 var New = errors.New 13 14 // Errorf creates an error based on a format string and values. Wrapped so that 15 // this package does not appear in the stack trace. 16 var Errorf = errors.Errorf 17 18 // Wrap wraps an error retrieved from outside of restic. Wrapped so that this 19 // package does not appear in the stack trace. 20 var Wrap = errors.Wrap 21 22 // Wrapf returns an error annotating err with the format specifier. If err is 23 // nil, Wrapf returns nil. 24 var Wrapf = errors.Wrapf