Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Leaving comment to reveal parsing error in configuration file #188

Open
jeffreyleeon opened this issue Nov 27, 2016 · 3 comments
Open

Leaving comment to reveal parsing error in configuration file #188

jeffreyleeon opened this issue Nov 27, 2016 · 3 comments

Comments

@jeffreyleeon
Copy link
Contributor

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.

jeffreyleeon added a commit to jeffreyleeon/mention-bot that referenced this issue Nov 27, 2016
jeffreyleeon added a commit to jeffreyleeon/mention-bot that referenced this issue Nov 27, 2016
jeffreyleeon added a commit to jeffreyleeon/mention-bot that referenced this issue Nov 27, 2016
vjeux pushed a commit that referenced this issue Nov 27, 2016
…#189)

* Refs #188, Add catch block for syntax error in config file

* Refs #188, Create comment to notify custom config file parsing error

* Refs #188, English improvements of the message
@hunkim
Copy link
Contributor

hunkim commented Nov 27, 2016

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

@jeffreyleeon
Copy link
Contributor Author

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

@jeffreyleeon
Copy link
Contributor Author

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

jeffreyleeon added a commit to jeffreyleeon/mention-bot that referenced this issue Nov 29, 2016
vjeux pushed a commit that referenced this issue Nov 29, 2016
…#190)

* Refs #188, add jsonlint library

* Refs #188, display jsonlint error log in comment as code block
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants