mirror of
https://github.com/restic/restic.git
synced 2025-10-09 07:33:53 +00:00
return exit code 10 if repository does not exist
This commit is contained in:
@@ -100,7 +100,9 @@ func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backen
|
||||
}
|
||||
|
||||
bucket, err := client.Bucket(ctx, cfg.Bucket)
|
||||
if err != nil {
|
||||
if b2.IsNotExist(err) {
|
||||
return nil, backend.ErrNoRepository
|
||||
} else if err != nil {
|
||||
return nil, errors.Wrap(err, "Bucket")
|
||||
}
|
||||
|
||||
|
@@ -2,10 +2,13 @@ package backend
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"hash"
|
||||
"io"
|
||||
)
|
||||
|
||||
var ErrNoRepository = fmt.Errorf("repository does not exist")
|
||||
|
||||
// Backend is used to store and access data.
|
||||
//
|
||||
// Backend operations that return an error will be retried when a Backend is
|
||||
|
Reference in New Issue
Block a user