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
Currently when there's an exception in a rake task, the message and backtrace of it is printed, but if that exception is wrapping another one, the inner one is ignored. Sometimes, that information is essential to be able to trace and fix a bug. It would be nice if rake printed that information.
I managed to make rake print it by monkey patching it with:
moduleRakeclassApplicationdefdisplay_error_message(ex)trace"#{name} aborted!"display_exception(ex)trace"Tasks: #{ex.chain}"ifhas_chain?(ex)trace"(See full trace by running task with --trace)"unlessoptions.backtraceendprivatedefdisplay_exception(ex,margin="")trace"#{margin}#{ex.message}"ifoptions.backtracetrace"#{margin}#{ex.backtrace.join("\n#{margin}")}"elsetrace"#{margin}#{Backtrace.collapse(ex.backtrace).join("\n#{margin}")}"endifex.respond_to?(:cause) && !ex.cause.nil?# Ruby < 2.1.0 doesn't have *cause*trace"#{margin}which was caused by:"display_exception(ex.cause,"#{margin} ")endendendend
If you would accept something like this in rake itself, I can create the appropriate pull request.
The text was updated successfully, but these errors were encountered:
Currently when there's an exception in a rake task, the message and backtrace of it is printed, but if that exception is wrapping another one, the inner one is ignored. Sometimes, that information is essential to be able to trace and fix a bug. It would be nice if rake printed that information.
I managed to make rake print it by monkey patching it with:
If you would accept something like this in rake itself, I can create the appropriate pull request.
The text was updated successfully, but these errors were encountered: