Closed troessner closed 8 years ago
Point 2 is definitely needed.
I think we should and can differentiate the message in our error handler to show known user errors differently. So instead of one message with a 'could be this, could be that' content, we show a more specific message if we know it's due to the configuration.
I think we should and can differentiate the message in our error handler to show known user errors differently.
I think this would be very hacky and brittle at best at the moment because we don't know what we, uhm, don't know :)
So instead of one message with a 'could be this, could be that' content, we show a more specific message if we know it's due to the configuration.
While I agree in theory, it might be that in practice this is not necessary anymore. We're working on validating the full configuration right now and on validating comments at runtime. As soon as this is done we don't need to differentiate at all because for every crash from then on can assume that's it's bad source / Reek-internal bug.
Related to #1069:
996 will help a lot making Reek more resilient but as already outlined in #1069 we kind of forgot that the majority of all errors the user makes in either the configuration or the source code comments that would have caused Reek to crash before will now result in this:
Which is highly confusing for the user and might lead to a lot of false-positives issues in the long run (like: "Reek told me to report this here, what now?").
Of course the best solution to this problem would be validate all configuration before running (or in case of comments while Reek is running and then print sth on STDERR or similar) which is something we are actively working on. But this might take a while since the problem is not trivial.
So I was wondering what we could do in the meantime and I have 2 suggestions:
1.) Improve the error message above
Instead of
I'd suggest to print:
2.) Fix the printing of the original exception
That was another thing we missed in our review :) As you can see above, we're only printing out the very last line. This should be a full stacktrace to make it easier on the user and on us.
WDYT?