Skip to content

Commit

Permalink
fix: reject the error directly (#4)
Browse files Browse the repository at this point in the history
`error` supplied in argument is an instance of class. Not a message string.
So, it throws `[object Object]` in the end.
  • Loading branch information
chay22 authored and Nargonath committed Apr 12, 2019
1 parent 07a7902 commit 993d6fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class TwitterOAuth {
this.oauthClient.getOAuthRequestToken(
(error, oauthRequestToken, oAuthRequestTokenSecret, results) => {
if (error) {
return reject(new Error(error));
return reject(error);
}

if (!results.oauth_callback_confirmed) {
Expand Down

0 comments on commit 993d6fb

Please sign in to comment.