facebookarchive/mention-bot

Leaving comment to reveal parsing error in configuration file

jeffreyleeon opened this issue · 3 comments

getRepoConfig function throughs error when .mention-bot is an invalid JSON.
Better to notify and reveal the parsing error by leaving comments when a pr is opened.

I like #188, but still, we don't provide a specific error message and where the error is.

Should we consider jsonlint.parse(json)?

Error: Parse error on line 1:
...ue", "boolean": true"}
-----------------------^
Expecting 'EOF', '}', ',', ']', got 'undefined'

http://stackoverflow.com/questions/13323356/parsing-faulty-json-and-be-able-to-display-where-the-error-is

Sure! We can try to improve the catch and give a more specific error message.

@hunkim
I have submitted a pr (#190) to display the specific error message. Please check if I am understanding it correctly. Thank you. :)