return exit code 10 if repository does not exist

This commit is contained in:
Michael Eischer
2024-07-10 21:46:26 +02:00
parent d76a78aa99
commit 94fdca08c4
32 changed files with 46 additions and 1 deletions

View File

@@ -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")
}

View File

@@ -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