aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc/src/error_handler.xml
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-01-18 11:48:39 +0100
committerBjörn Gustavsson <[email protected]>2013-01-18 11:48:39 +0100
commit209a479080214ab901116d48b90e91d6c056278d (patch)
tree726530a014b480b4befd222d83a3cc5f63cd3d77 /lib/kernel/doc/src/error_handler.xml
parent35adf88290339ecdbbcd0a1290032d599bda26c4 (diff)
parentf22da5738e7fd4995d177d602c29bd80d8072ccc (diff)
downloadotp-209a479080214ab901116d48b90e91d6c056278d.tar.gz
otp-209a479080214ab901116d48b90e91d6c056278d.tar.bz2
otp-209a479080214ab901116d48b90e91d6c056278d.zip
Merge branch 'bjorn/kernel/undefined-function-handler/OTP-10617'
* bjorn/kernel/undefined-function-handler/OTP-10617: Teach error_handler to call '$handle_undefined_function'
Diffstat (limited to 'lib/kernel/doc/src/error_handler.xml')
-rw-r--r--lib/kernel/doc/src/error_handler.xml38
1 files changed, 29 insertions, 9 deletions
diff --git a/lib/kernel/doc/src/error_handler.xml b/lib/kernel/doc/src/error_handler.xml
index acbf9a2c6e..610b65f0a2 100644
--- a/lib/kernel/doc/src/error_handler.xml
+++ b/lib/kernel/doc/src/error_handler.xml
@@ -43,19 +43,39 @@
A (possibly empty) list of arguments <c>Arg1,..,ArgN</c>
</type_desc>
<desc>
- <p>This function is evaluated if a call is made to
+ <p>This function is called by the run-time system if a call is made to
<c><anno>Module</anno>:<anno>Function</anno>(Arg1,.., ArgN)</c> and
<c><anno>Module</anno>:<anno>Function</anno>/N</c> is undefined. Note that
<c>undefined_function/3</c> is evaluated inside the process
making the original call.</p>
- <p>If <c><anno>Module</anno></c> is interpreted, the interpreter is invoked
- and the return value of the interpreted
- <c><anno>Function</anno>(Arg1,.., ArgN)</c> call is returned.</p>
- <p>Otherwise, it returns, if possible, the value of
- <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> after an attempt has been
- made to autoload <c><anno>Module</anno></c>. If this is not possible, the
- call to <c><anno>Module</anno>:<anno>Function</anno>(Arg1,.., ArgN)</c> fails with
- exit reason <c>undef</c>.</p>
+
+ <p>This function will first attempt to autoload
+ <c><anno>Module</anno></c>. If that is not possible,
+ an <c>undef</c> exception will be raised.</p>
+
+ <p>If it was possible to load <c><anno>Module</anno></c>
+ and the function <c><anno>Function</anno>/N</c> is exported,
+ it will be called.</p>
+
+ <p>Otherwise, if the function <c>'$handle_undefined_function'/2</c>
+ is exported, it will be called as
+ <c>'$handle_undefined_function'(</c><anno>Function</anno>,
+ <anno>Args</anno>).
+ </p>
+ <p>Otherwise an <c>undef</c> exception will be raised.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="raise_undef_exception" arity="3"/>
+ <fsummary>Raise an undef exception</fsummary>
+ <type_desc variable="Args">
+ A (possibly empty) list of arguments <c>Arg1,..,ArgN</c>
+ </type_desc>
+ <desc>
+ <p>Raise an <c>undef</c> exception with a stacktrace indicating
+ that <c><anno>Module</anno>:<anno>Function</anno>/N</c> is
+ undefined.
+ </p>
</desc>
</func>
<func>