From a604fd69724bd15f463051d5cdfd6c5a0c83f054 Mon Sep 17 00:00:00 2001 From: John Mair Date: Sat, 12 Jan 2013 22:15:25 +0100 Subject: [PATCH] show-source: prettier error messages --- lib/pry/commands/show_source.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pry/commands/show_source.rb b/lib/pry/commands/show_source.rb index 73356d2e..0748d067 100644 --- a/lib/pry/commands/show_source.rb +++ b/lib/pry/commands/show_source.rb @@ -25,6 +25,7 @@ class Pry # The source for code_object prepared for display. def content_for(code_object) + raise CommandError, "Cannot locate source!" if !code_object.source Code.new(code_object.source, start_line_for(code_object)). with_line_numbers(use_line_numbers?).to_s end