Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Erlang's method_missing : '$handle_undefined_function'
-module(method_missing).
-export(['$handle_undefined_function'/2]).
'$handle_undefined_function'(Func, Args) ->
io:format("Called undefined function '~p' with args ~p.~n", [Func, Args]).
Owner

dongyuwei commented Jun 20, 2017 edited

https://github.com/erlang/otp/blob/maint/lib/kernel/src/error_handler.erl#L139

test in erl shell

c(method_missing).
method_missing:foobar(1,2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment