aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-01-24 12:03:21 +0100
committerBjörn Gustavsson <[email protected]>2013-01-24 12:03:21 +0100
commit7ba536872c3cb1db2e7c8a29c1886b4601f853a4 (patch)
tree121fd0814ce20809a3741cff3bfe5be43e07b0f3 /lib/kernel/doc/src
parent21c1b8261c5cc39515de8ff65e4fa9a9405e1399 (diff)
parent73fb496d2f072ab5b026d71faec3cc2b8907a268 (diff)
downloadotp-7ba536872c3cb1db2e7c8a29c1886b4601f853a4.tar.gz
otp-7ba536872c3cb1db2e7c8a29c1886b4601f853a4.tar.bz2
otp-7ba536872c3cb1db2e7c8a29c1886b4601f853a4.zip
Merge branch 'bjorn/kernel/undefined-function-handler/OTP-10617'
* bjorn/kernel/undefined-function-handler/OTP-10617: Add a warning to discourage abuse of $handle_undefined_function/2
Diffstat (limited to 'lib/kernel/doc/src')
-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>