There should be some way to make the formatter fail-fast: handleException should then rethrow the exception and thus end the formatting immediately. This would be especially useful for testing (for example, the test for #27 currently “succeeds” even if it fails – the difference is only that in one case a stacktrace is printed and in the other case not) and development in general.
I’m not sure if this needs to be a regular option or a parameter of FormattingVisitor. I’m leaning towards the latter, since it doesn’t influence how the code looks, and it’s mostly for internal use.
There should be some way to make the formatter fail-fast:
handleException
should then rethrow the exception and thus end the formatting immediately. This would be especially useful for testing (for example, the test for #27 currently “succeeds” even if it fails – the difference is only that in one case a stacktrace is printed and in the other case not) and development in general.I’m not sure if this needs to be a regular option or a parameter of
FormattingVisitor
. I’m leaning towards the latter, since it doesn’t influence how the code looks, and it’s mostly for internal use.