You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments