A nicer error message when 'run' fails.

This commit is contained in:
epitron 2011-04-18 15:18:44 -04:00
parent ffad3171b7
commit 0b07a9fab8
1 changed files with 1 additions and 0 deletions

View File

@ -95,6 +95,7 @@ class Pry
if command_processor.system_command?(name) if command_processor.system_command?(name)
command_processor.execute_system_command("#{name} #{args.join(' ')}", target) command_processor.execute_system_command("#{name} #{args.join(' ')}", target)
else else
raise "#{name.inspect} is not a valid pry command." unless opts[:commands].include? name
action = opts[:commands][name][:action] action = opts[:commands][name][:action]
instance_exec(*args, &action) instance_exec(*args, &action)
end end