匹配错误
当我们调用一个传入错误参数的内建函数时,参数不匹配的函数时,匹配错误就会产生。
当遇到匹配错误时,系统的行为可以描述成以下几种情形:
- if(called a BIF with bad args)then
- Error = badarg
- elseif(cannot and a matching function)then
- Error = badmatch
- elseif(no matching case statement)then
- Error = case_clause
- ...
- if(within the scope of a “catch”)then
- Value of “catch” = {'EXIT', Error}
- else
- broadcast(Error)
- die
- endif
其中“broadcast(Error)”可以描述为:
- if(Process has Links)then
- send {'EXIT', self(), Reason} signals to all linked
- processes
- endif