Merge pull request #4884 from MichaelEischer/lock-and-not-exist-error-codes

Return different exit code if repo is locked or does not exist
This commit is contained in:
Michael Eischer
2024-07-12 21:05:52 +02:00
committed by GitHub
41 changed files with 195 additions and 42 deletions
+3 -1
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")
}
+3
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