mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Prefix fallback "output error" with "(pry)"
robgleeson reported that the message could be confusing if you weren't expecting it.
This commit is contained in:
parent
f0e8ebbea4
commit
3549cc108b
2 changed files with 5 additions and 5 deletions
|
@ -263,12 +263,12 @@ class Pry
|
|||
# serialize something in the user's program, let's not assume we can serialize
|
||||
# the exception either.
|
||||
begin
|
||||
output.puts "output error: #{e.inspect}"
|
||||
output.puts "(pry) output error: #{e.inspect}"
|
||||
rescue RescuableException => e
|
||||
if last_result_is_exception?
|
||||
output.puts "output error: failed to show exception"
|
||||
output.puts "(pry) output error: failed to show exception"
|
||||
else
|
||||
output.puts "output error: failed to show result"
|
||||
output.puts "(pry) output error: failed to show result"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ describe Pry do
|
|||
it "should display serialization exceptions" do
|
||||
Pry.config.print = lambda { |*a| raise "catch-22" }
|
||||
|
||||
mock_pry("1").should =~ /output error: #<RuntimeError: catch-22>/
|
||||
mock_pry("1").should =~ /\(pry\) output error: #<RuntimeError: catch-22>/
|
||||
end
|
||||
|
||||
it "should catch errors serializing exceptions" do
|
||||
|
@ -24,7 +24,7 @@ describe Pry do
|
|||
raise Exception.new("catch-22").tap{ |e| class << e; def inspect; raise e; end; end }
|
||||
end
|
||||
|
||||
mock_pry("1").should =~ /output error: failed to show result/
|
||||
mock_pry("1").should =~ /\(pry\) output error: failed to show result/
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue