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

Callback error should be an Error instance, not a plain object #345

Closed
sindresorhus opened this issue Jan 12, 2015 · 2 comments · Fixed by #346
Closed

Callback error should be an Error instance, not a plain object #345

sindresorhus opened this issue Jan 12, 2015 · 2 comments · Fixed by #346
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@sindresorhus
Copy link

That is the Node convention and the expected output.

See: GoogleChromeLabs/psi#43

Test-case

var googleapis = require('googleapis');
var pagespeed = googleapis.pagespeedonline('v1').pagespeedapi.runpagespeed;

// intentional grammar mistake to trigger the error
pagespeed({url: 'http://google.con'}, function (err, response) {
  if (err) {
    throw err;
    //=> [object Object]
  }
});

It should throw the error with stack, but instead just throws [object Object].

@robertrossmann
Copy link
Contributor

Thanks for the report!

@ryanseys
Copy link
Contributor

Fixed in v1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants