aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-01-23 11:41:28 +0100
committerBjörn Gustavsson <[email protected]>2013-01-23 11:41:28 +0100
commit73fb496d2f072ab5b026d71faec3cc2b8907a268 (patch)
tree52a4e8adc293972d686807b6b041a711a183ae22 /lib/kernel
parent744228a03cde1a45e905d563da2546419926c7ee (diff)
downloadotp-73fb496d2f072ab5b026d71faec3cc2b8907a268.tar.gz
otp-73fb496d2f072ab5b026d71faec3cc2b8907a268.tar.bz2
otp-73fb496d2f072ab5b026d71faec3cc2b8907a268.zip
Add a warning to discourage abuse of $handle_undefined_function/2
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/doc/src/error_handler.xml13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/kernel/doc/src/error_handler.xml b/lib/kernel/doc/src/error_handler.xml
index 610b65f0a2..769a869ffa 100644
--- a/lib/kernel/doc/src/error_handler.xml
+++ b/lib/kernel/doc/src/error_handler.xml
@@ -62,6 +62,19 @@
<c>'$handle_undefined_function'(</c><anno>Function</anno>,
<anno>Args</anno>).
</p>
+ <warning>
+ <p>Defining <c>'$handle_undefined_function'/2</c> in
+ ordinary application code is highly discouraged. It is very
+ easy to make subtle errors that can take a long time to
+ debug. Furthermore, none of the tools for static code
+ analysis (such as Dialyzer and Xref) supports the use of
+ <c>'$handle_undefined_function'/2</c> and no such support
+ will be added. Only use this function after having carefully
+ considered other, less dangerous, solutions. One example of
+ potential legitimate use is creating stubs for other
+ sub-systems during testing and debugging.
+ </p>
+ </warning>
<p>Otherwise an <c>undef</c> exception will be raised.</p>
</desc>
</func>