Improved error message for unlocatable methods.
* explicitly stating that source_location is nil
This commit is contained in:
parent
1a26088670
commit
42fca560e0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue