Backport exception handling fixes.
The recent changes to printing also required these fixes.
This commit is contained in:
parent
58b1907123
commit
0e119555de
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue