defunctzombie / node-required

identifies which modules your script is using
67 stars 15 forks source link

Error handling of files with errors throws error client can't catch #15

Closed Michieljoris closed 9 years ago

Michieljoris commented 10 years ago

On line 147 an any thrown errors are propagated. However this is happening in a async callback of fs.readFile.

This crashes the client app since it can't catch the error. Perhaps use either fs.readFileSync or replace throw e with cb(err).

I've done the latter in my fork so I can handle the error.

defunctzombie commented 10 years ago

a PR / failing test would be nice if you have already fixed this