Backport exception handling fixes.

The recent changes to printing also required these fixes.
This commit is contained in:
Conrad Irwin 2011-08-27 01:58:53 -07:00
parent 58b1907123
commit 0e119555de
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ class Pry
DEFAULT_PRINT = proc do |output, value|
stringified = begin
value.pretty_inspect
rescue Exception => ex
rescue RescuableException => ex
nil
end

View File

@ -223,13 +223,13 @@ class Pry
else
print.call output, result
end
rescue Exception => e
rescue RescuableException => e
# Being uber-paranoid here, given that this exception arose because we couldn't
# serialize something in the user's program, let's not assume we can serialize
# the exception either.
begin
output.puts "output error: #{e.inspect}"
rescue Exception => e
rescue RescuableException => e
if last_result_is_exception?
output.puts "output error: failed to show exception"
else