Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unhandledRejections, help with cache eacces #227

Closed

Commits on Aug 1, 2019

  1. Handle unhandledRejections, help with cache eacces

    Suggested by @godmar in
    https://npm.community/t/npm-err-cb-never-called-permission-denied/9167/5
    
    Incidentally, this turned up that we're catching uncaughtExceptions in
    the main npm functions, but not unhandledRejections!
    
    Tracing this through, it seems like node-fetch-npm's use of cacache is
    particularly brittle.  Any throw that comes from cacache is not caught
    properly, since node-fetch-npm is all streams and callbacks.  The naive
    approach (just adding a catch and failing the callback) doesn't work,
    because then make-fetch-happen and npm-registry-fetch interpret the
    failure as an invalid response, when actually it was a local cache
    error.
    
    So, a bit more love and polish is definitely still needed in the
    guts of npm's fetching and caching code paths.  In the meantime, though,
    handling any unhandledRejection at the top level prevents at least the
    worst and most useless type of error message.
    isaacs committed Aug 1, 2019
    Copy the full SHA
    d8a143a View commit details
    Browse the repository at this point in the history