Improved error message for unlocatable methods.

* explicitly stating that source_location is nil
This commit is contained in:
John Mair 2012-03-28 05:07:55 +13:00
parent 1a26088670
commit 42fca560e0
1 changed files with 1 additions and 1 deletions

View File

@ -411,7 +411,7 @@ class Pry
# @raise [CommandError] Raises when the method can't be found or `pry-doc` isn't installed.
def pry_doc_info
if Pry.config.has_pry_doc
Pry::MethodInfo.info_for(@method) or raise CommandError, "Cannot locate this method: #{name}."
Pry::MethodInfo.info_for(@method) or raise CommandError, "Cannot locate this method: #{name}. (source_location returns nil)"
else
raise CommandError, "Cannot locate this method: #{name}. Try `gem install pry-doc` to get access to Ruby Core documentation."
end