mirror of
https://github.com/restic/restic.git
synced 2025-12-14 13:02:04 +00:00
errors: standardize error wrapping for Fatal errors
* replace all occurences of `errors.Fatal(err.Error())` with `errors.Fatalf("%s", err)` so that the error wrapping is correct across the codebase
* updated the review comments
This commit is contained in:
@@ -486,7 +486,7 @@ func OpenRepository(ctx context.Context, opts GlobalOptions) (*repository.Reposi
|
||||
NoExtraVerify: opts.NoExtraVerify,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Fatal(err.Error())
|
||||
return nil, errors.Fatalf("%s", err)
|
||||
}
|
||||
|
||||
passwordTriesLeft := 1
|
||||
@@ -613,7 +613,7 @@ func innerOpen(ctx context.Context, s string, gopts GlobalOptions, opts options.
|
||||
|
||||
rt, err := backend.Transport(globalOptions.TransportOptions)
|
||||
if err != nil {
|
||||
return nil, errors.Fatal(err.Error())
|
||||
return nil, errors.Fatalf("%s", err)
|
||||
}
|
||||
|
||||
// wrap the transport so that the throughput via HTTP is limited
|
||||
|
||||
Reference in New Issue
Block a user