errors: Ensure that errors.IsFatal(errors.Fatal("err")) == true

This fixes a few cases where restic output "Fatal: Fatal: [...]"
This commit is contained in:
Michael Eischer
2022-03-28 22:09:49 +02:00
parent a08b95c497
commit 2e1613d4c6
4 changed files with 26 additions and 2 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ func main() {
fmt.Fprintf(os.Stderr, "%v\nthe `unlock` command can be used to remove stale locks\n", err)
case err == ErrInvalidSourceData:
fmt.Fprintf(os.Stderr, "Warning: %v\n", err)
case errors.IsFatal(errors.Cause(err)):
case errors.IsFatal(err):
fmt.Fprintf(os.Stderr, "%v\n", err)
case err != nil:
fmt.Fprintf(os.Stderr, "%+v\n", err)