lib/console/event/failure.rb in console-1.2.2 vs lib/console/event/failure.rb in console-1.2.3

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literals: true +# # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights @@ -49,11 +51,11 @@ def format(output, terminal, verbose) format_exception(@exception, nil, output, terminal, verbose) end - def format_exception(exception, prefix = nil, output, terminal, verbose) + def format_exception(exception, prefix, output, terminal, verbose) lines = exception.message.lines.map(&:chomp) output.puts " #{prefix}#{terminal[:exception_title]}#{exception.class}#{terminal.reset}: #{lines.shift}" lines.each do |line| @@ -68,10 +70,10 @@ output.puts " #{index == 0 ? "→" : " "} #{terminal[:exception_backtrace]}#{path}:#{offset}#{terminal.reset} #{message}" end if exception.cause and verbose - format_exception(exception.cause, "Caused by ", output, terminal) + format_exception(exception.cause, "Caused by ", output, terminal, verbose) end end end end end