Certain internal errors get thrown on parse issues, which makes it impossible to open a switch statement on them.
This PR removes those, instead returning the latest error, which seems to be the most relevant from the parse tests I ran.
Sample protolint output from previous errors:
As you can see, both errors are very similar. In my opinion, the second one is slightly more helpful; hence why i return that one. They are both guaranteed to be non-nil given the previous if statements.
Certain internal errors get thrown on parse issues, which makes it impossible to open a switch statement on them.
This PR removes those, instead returning the latest error, which seems to be the most relevant from the parse tests I ran.
Sample protolint output from previous errors:![image](https://user-images.githubusercontent.com/17353640/69878168-08dbde00-12bc-11ea-9638-a791b9b993cc.png)
As you can see, both errors are very similar. In my opinion, the second one is slightly more helpful; hence why i return that one. They are both guaranteed to be non-nil given the previous if statements.