forked from TrueCloudLab/restic
lock: cleanup error message
The error message is now `Fatal: unable to create lock in backend: [...]` instead of `unable to create lock in backend: Fatal: [...]`.
This commit is contained in:
parent
1adf28a2b5
commit
c995b5be52
2 changed files with 3 additions and 3 deletions
|
@ -2,11 +2,11 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/debug"
|
"github.com/restic/restic/internal/debug"
|
||||||
|
"github.com/restic/restic/internal/errors"
|
||||||
"github.com/restic/restic/internal/restic"
|
"github.com/restic/restic/internal/restic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ func lockRepository(ctx context.Context, repo restic.Repository, exclusive bool)
|
||||||
|
|
||||||
lock, err := lockFn(ctx, repo)
|
lock, err := lockFn(ctx, repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, ctx, fmt.Errorf("unable to create lock in backend: %w", err)
|
return nil, ctx, errors.Fatalf("unable to create lock in backend: %v", err)
|
||||||
}
|
}
|
||||||
debug.Log("create lock %p (exclusive %v)", lock, exclusive)
|
debug.Log("create lock %p (exclusive %v)", lock, exclusive)
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ func (l *Lock) checkForOtherLocks(ctx context.Context) error {
|
||||||
// if we cannot load a lock then it is unclear whether it can be ignored
|
// if we cannot load a lock then it is unclear whether it can be ignored
|
||||||
// it could either be invalid or just unreadable due to network/permission problems
|
// it could either be invalid or just unreadable due to network/permission problems
|
||||||
debug.Log("ignore lock %v: %v", id, err)
|
debug.Log("ignore lock %v: %v", id, err)
|
||||||
return errors.Fatal(err.Error())
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if l.Exclusive {
|
if l.Exclusive {
|
||||||
|
|
Loading…
Reference in a new issue