Permalink
Browse files

Make pryrc load errors more useful.

As it stands pryrc leaves you clueless about where an error happens, this small changes makes it so that .load_file_at_toplevel at least returns e.backtrace.first so that users get hinted at the file causing the issue.  This is extremely useful when doing requires from inside of pryrc.
  • Loading branch information...
1 parent 955580e commit 271a9aad120ebf6a1f994c28c31f39c9a72735ff @envygeeks envygeeks committed Jan 1, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/pry/pry_class.rb
View
1 lib/pry/pry_class.rb
@@ -70,6 +70,7 @@ def self.load_file_at_toplevel(file_name)
toplevel_binding.eval(File.read(full_name), full_name) if File.exists?(full_name)
rescue RescuableException => e
puts "Error loading #{file_name}: #{e}"
+ puts e.backtrace.first
end
end

0 comments on commit 271a9aa

Please sign in to comment.