When a run-time error occurs,
that is an exception of class error
,
the exit reason is a tuple {Reason,Stack}
.
Reason
is a term indicating the type of error:
Reason | Type of error |
badarg
|
Argument is of wrong type. |
|
Argument is of wrong type in an arithmetic expression. |
{badmatch,V}
|
Evaluation of a match expression failed. The value V did not match.
|
function_clause
|
No matching function clause is found when evaluating a function call. |
{case_clause,V}
|
No matching branch is found when evaluating a case expression. The value V did not match.
|
|
No true branch is found when evaluating an if expression. |
{try_clause,V}
|
No matching branch is found when evaluating the of-section of a a try expression. The value V did not match.
|
undef
|
The function cannot be found when evaluating a function call. |
{badfun,F}
|
There is something wrong with a fun F .
|
{badarity,F}
|
A fun is applied to the wrong number of arguments.F describes the fun and the arguments.
|
timeout_value
|
The timeout value in a receive..after expression isevaluated to something else than an integer or infinity .
|
noproc
|
Trying to link to a non-existing process. |
{nocatch,V}
|
Trying to evaluate a throw outside a catch .V is the throw term.
|
system_limit
|
A system limit has been reached. See Efficiency Guide for information about system limits. |
Stack
is the stack of function calls being evaluated
when the error occurred, given as a list of tuples
{Module,Name,Arity}
with the most recent function call
first. The most recent function call tuple may in some
cases be {Module,Name,[Arg]}
.
One Reply to “Erlang Error Messages”