Improve UndefinedFunctionError

* Detect undefined errors for compiling modules
* Log undefined errors in Task's like other OTP processes
* Normalize undefined errors from OTP processes

It would be nice to add tests for the last two bullet points but wanted to check this is an acceptable approach first.
Cool

jason
On Sep 9, 2014 4:46 PM, "James Fish" <notifications@github.com> wrote:

> In lib/elixir/lib/exception.ex:
>
> >      end
> >    end
> > +
> > +  def message(%{reason: :"module could not be loaded", module: module, function: function, arity: arity}) do
> > +    "undefined function: " <> Exception.format_mfa(module, function, arity) <>
> > +      " (module #{inspect module} is not available)"
> > +  end
> > +
> > +  def message(%{reason: :"function not exported",  module: module, function: function, arity: arity}) do
> > +    "nil." <> fa = Exception.format_mfa(nil, function, arity)
> > +    "undefined function: " <> Exception.format_mfa(module, function, arity) <>
> > +      " (function #{fa} not exported from #{inspect module})"
>
> It is just being explicit (in comparison to the other two suffixes). I
> added the message just because of how OTP processes switch the :undef for :"function
> not exported". Perhaps it is the cond clauses in the reason: nil section
> that are redundant?
>
> I will fix the build and add a couple of tests which show should the
> difference better.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/elixir-lang/elixir/pull/2762/files#r17335644>.
>