Skip to content

Commit 8529d01

Browse files
author
Marius
authored
Merge pull request #4 from tus/retry-errors
Suggest retry if lockfile disappears
2 parents d430f77 + c9a040d commit 8529d01

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lockfile.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ func (l Lockfile) TryLock() error {
138138
_, err = l.GetOwner()
139139
switch err {
140140
default:
141+
if os.IsNotExist(err) {
142+
// tell user that a retry would be a good idea
143+
return ErrNotExist
144+
}
141145
// Other errors -> defensively fail and let caller handle this
142146
return err
143147
case nil:

0 commit comments

Comments
 (0)