Open nillis opened 8 years ago
The comment above explains it:
// best-effort. unlocking an already-unlocked lock is a noop
It's quite common to get ENOENT errors here because the lock doesn't exist. Probably any other kind of error could be raised, though, I guess?
Idd. I just gave the remark because I saw error handling on the unlock method in the npm repository, but I knew the error is not passed to the callback.
Why not just pass the unlink error as the second argument to callback instead of the first arg to the callback? or if there are multiple errors, just pass an array of errors as the second arg?
Is there a reason why the unlinkEr is not passed to the callback? https://github.com/npm/lockfile/blob/master/lockfile.js#L61