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

catch e, but return err #64

Open
pmelisko opened this issue Jan 4, 2018 · 0 comments
Open

catch e, but return err #64

pmelisko opened this issue Jan 4, 2018 · 0 comments

Comments

@pmelisko
Copy link

pmelisko commented Jan 4, 2018

In fileAnalyze function (lib/require-analyzer.js) there is bug, if there is something wrong in detective.find (i.e. es6/7 features in my case) a get empty result. It is caused by calling callback with null (err instead of e, see that second callback in code below)

fs.readFile(options.target, function(err, data){
    if(err) return callback(err);

    var files;

    try {
      files = detective.find(data.toString('utf8'));
    } catch(e){
      return callback(err);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant