Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Unlink error not passed to callback #18

Open
nillis opened this issue Jun 3, 2016 · 3 comments
Open

Unlink error not passed to callback #18

nillis opened this issue Jun 3, 2016 · 3 comments

Comments

@nillis
Copy link

nillis commented Jun 3, 2016

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

@isaacs
Copy link
Contributor

isaacs commented Jun 5, 2016

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
Copy link
Author

nillis commented Jun 5, 2016

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
Copy link
Contributor

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants