Skip to content

Commit

Permalink
Refs facebookarchive#188, Create comment to notify custom config file…
Browse files Browse the repository at this point in the history
… parsing error
  • Loading branch information
jeffreyleeon committed Nov 27, 2016
1 parent cff225e commit 231df83
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ async function work(body) {
Accept: 'application/vnd.github.v3.raw+json'
}
}).catch(function(e) {
if (e instanceof SyntaxError) {
if (e instanceof SyntaxError && repoConfig.actions.indexOf(data.action) !== -1) {
// Syntax error while reading custom configuration file

var message =
'Unable to parse mention-bot custom configuration file due to syntax error.\n' +
'Please check the potential errors below:\n\n' +
'1. Invalid JSON type\n' +
'2. Having extra "," in the last JSON attribute';
createComment(data, message);
}
});

Expand Down

0 comments on commit 231df83

Please sign in to comment.