Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Commit

Permalink
Better error handling for Tweet failure
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Aug 16, 2018
1 parent b8d6d8d commit bf57a54
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils/twitter-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Nocturn prohibits over 20 mentions per minute.`);
TwitterClient.handleError('tweet', data.error);
return;
}
if (data.errors) {
TwitterClient.handleError('tweet', data.errors);
return;
}
callback(data);
});
}
Expand Down Expand Up @@ -179,9 +183,6 @@ Nocturn prohibits over 20 mentions per minute.`);

static handleError(action, error) {
alert(`Failed to ${action}!
Error: ${JSON.stringify(error)}
Please see: https://github.com/k0kubun/Nocturn/releases
or notify this error message to @k0kubun.`);
Error: ${JSON.stringify(error)}`);
}
}

0 comments on commit bf57a54

Please sign in to comment.