now passing pry instance as 3rd parameter to exception_handler proc

This commit is contained in:
John Mair 2011-09-11 04:39:51 +12:00
parent 1779ee499d
commit 90d88d3492
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class Pry
end
# Will only show the first line of the backtrace
DEFAULT_EXCEPTION_HANDLER = proc do |output, exception|
DEFAULT_EXCEPTION_HANDLER = proc do |output, exception, _|
output.puts "#{exception.class}: #{exception.message}"
output.puts "from #{exception.backtrace.first}"
end

View File

@ -254,7 +254,7 @@ class Pry
# Output the result or pass to an exception handler (if result is an exception).
def show_result(result)
if last_result_is_exception?
exception_handler.call output, result
exception_handler.call output, result, self
else
print.call output, result
end