Currently, a bunch of developers are using XHPAST for writing custom linter rules. As such, we end up with a fair few XHPASTSyntaxErrorException in our PHP error logs. I think that throwing an exception is not quite correct in this case because it is somewhat expected that invalid PHP may be entered. Instead, catch the exception and show the user a helpful message.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- Restricted Diffusion Commit
rPa2f909f0bd0a: Improve XHPAST handling of syntax errors
This doesn't quite work yet... the stream and tree views render as blank but the exceptions still propogate to the error logs. Mostly, I'm not sure how the exception should be rendered for display.
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Branch
- master
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 8700 Build 10098: Run Core Tests Build 10097: arc lint + arc unit
Event Timeline
Comment Actions
Maybe just put the stuff on the main page?
So you normally get this:
Phabricator > XHPAST > Tree 92 +--------+-----+--------+ | source | ast | tokens | +--------+-----+--------+
..but just do this?
Phabricator > XHPAST > Tree 93 >> ERROR: You are bad at syntax! << +--------+---------+---------+ | source | (empty) | (empty) | +--------+---------+---------+