mirror of https://github.com/restic/restic.git
Revive hint to the unlock command if a repository is locked
errors.Fatalf wraps a error and just keeps an error message as a string. This prevents the `restic.IsAlreadyLocked(err)` check from working as the error is no longer an ErrAlreadyLocked. Just add an additional remark to the error using `errors.WithMessage`.
This commit is contained in:
parent
6856d1e422
commit
087c770161
|
@ -36,7 +36,7 @@ func lockRepository(repo *repository.Repository, exclusive bool) (*restic.Lock,
|
||||||
|
|
||||||
lock, err := lockFn(context.TODO(), repo)
|
lock, err := lockFn(context.TODO(), repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Fatalf("unable to create lock in backend: %v", err)
|
return nil, errors.WithMessage(err, "unable to create lock in backend")
|
||||||
}
|
}
|
||||||
debug.Log("create lock %p (exclusive %v)", lock, exclusive)
|
debug.Log("create lock %p (exclusive %v)", lock, exclusive)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue