mirror of
https://github.com/restic/restic.git
synced 2025-10-09 07:33:53 +00:00
rest/sftp: Remove redundant fatal from error message
This caused restic to exit with error messages like `Fatal: parsing repository location failed: Fatal: sftp path [...]` `Fatal: create repository at rest:http://localhost:12345/ failed: Fatal: config file already exists`
This commit is contained in:
@@ -62,7 +62,7 @@ func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (*Backend, er
|
||||
|
||||
_, err = be.Stat(ctx, restic.Handle{Type: restic.ConfigFile})
|
||||
if err == nil {
|
||||
return nil, errors.Fatal("config file already exists")
|
||||
return nil, errors.New("config file already exists")
|
||||
}
|
||||
|
||||
url := *cfg.URL
|
||||
@@ -76,7 +76,7 @@ func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (*Backend, er
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, errors.Fatalf("server response unexpected: %v (%v)", resp.Status, resp.StatusCode)
|
||||
return nil, fmt.Errorf("server response unexpected: %v (%v)", resp.Status, resp.StatusCode)
|
||||
}
|
||||
|
||||
_, err = io.Copy(io.Discard, resp.Body)
|
||||
|
Reference in New Issue
Block a user