elixir-lang/elixir — pull request #1971 by rcillo (2013-12-30 03:59:02+00:00)
Title: Improve error message for IEx.Helpers.r when module does not exist.

Fixes https://github.com/elixir-lang/elixir/issues/1968

Before this commit, when trying to reload an unloaded module, the
user would see an error like:

iex(1)> r InexistentModule
** (UndefinedFunctionError) undefined function: InexistentModule.module_info/1
InexistentModule.module_info(:compile)
lib/iex/lib/iex/helpers.ex:352: IEx.Helpers.source/1
lib/iex/lib/iex/helpers.ex:311: IEx.Helpers.do_r/1
lib/iex/lib/iex/helpers.ex:304: IEx.Helpers.r/1

After this commit, the user should see

iex(1)> r InexistentModule
** (ArgumentError) Unloaded module Elixir.InexistentModule. Try loading the module's beam file with `IEx.Helpers.l\1`
lib/iex/lib/iex/helpers.ex:312: IEx.Helpers.do_r/1
lib/iex/lib/iex/helpers.ex:304: IEx.Helpers.r/1

Which is more informative.