Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify output when printing nested exception traces
Since v10.2.0, if an exception has a nested cause exception, the cause is also displayed in the trace output.[1] For heavily-nested exceptions, this output can be quite lengthy - for example, Rails migrations nest DB errors twice over, resulting in an error message and backtrace repeated three times. To break up this output and make it clearer what each individual backtrace relates to, this adds whitespace and a "Caused by:" label to each nested exception being displayed. To prevent "Caused by:" labels occurring on their own, I've moved the exception loop shortcut return into the `#display_cause_details` method. This doesn't alter the behaviour of the shortcut, as only the first exception will be unconditionally printed (which was already the case, as the first exception can't be already seen). [1] fbb22e7 [2] 57c932c
- Loading branch information