npm / lockfile

A very polite lock file utility, which endeavors to not litter, and to wait patiently for others.
ISC License
260 stars 33 forks source link

Unlink error not passed to callback #18

Open nillis opened 8 years ago

nillis commented 8 years ago

Is there a reason why the unlinkEr is not passed to the callback? https://github.com/npm/lockfile/blob/master/lockfile.js#L61

isaacs commented 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?

nillis commented 8 years ago

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.

ORESoftware commented 6 years ago

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?