Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
error_handler(3)	   Erlang Module Definition	      error_handler(3)

NAME
       error_handler - Default System Error Handler

DESCRIPTION
       The error handler module	defines	what happens when certain types	of er-
       rors occur.

EXPORTS
       undefined_function(Module, Function, Args) -> any()

	      Types:

		 Module	= Function = atom()
		 Args =	list()
		    A (possibly	empty) list of arguments Arg1,..,ArgN

	      This function is called by the run-time system if	a call is made
	      to Module:Function(Arg1,.., ArgN)	and Module:Function/N is unde-
	      fined. Note that undefined_function/3 is	evaluated  inside  the
	      process making the original call.

	      This  function will first	attempt	to autoload Module. If that is
	      not possible, an undef exception will be raised.

	      If it was	possible to load Module	and the	function Function/N is
	      exported,	it will	be called.

	      Otherwise, if the	function '$handle_undefined_function'/2	is ex-
	      ported, it will be called	as  '$handle_undefined_function'(Func-
	      tion, Args).

	  Warning:
	      Defining	'$handle_undefined_function'/2 in ordinary application
	      code is highly discouraged. It is	very easy to make  subtle  er-
	      rors  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 '$handle_undefined_function'/2 and no such
	      support will be added. Only use this function after having care-
	      fully  considered	 other,	less dangerous,	solutions. One example
	      of potential legitimate use is creating stubs for	other sub-sys-
	      tems during testing and debugging.

	      Otherwise	an undef exception will	be raised.

       raise_undef_exception(Module, Function, Args) ->	no_return()

	      Types:

		 Module	= Function = atom()
		 Args =	list()
		    A (possibly	empty) list of arguments Arg1,..,ArgN

	      Raise  an	undef exception	with a stacktrace indicating that Mod-
	      ule:Function/N is	undefined.

       undefined_lambda(Module,	Fun, Args) -> term()

	      Types:

		 Module	= atom()
		 Fun = function()
		 Args =	list()
		    A (possibly	empty) list of arguments Arg1,..,ArgN

	      This function is evaluated if a call  is	made  to  Fun(Arg1,..,
	      ArgN)  when the module defining the fun is not loaded. The func-
	      tion is evaluated	inside the process making the original call.

	      If Module	is interpreted,	the interpreter	is invoked and the re-
	      turn  value  of  the  interpreted	Fun(Arg1,.., ArgN) call	is re-
	      turned.

	      Otherwise, it returns, if	 possible,  the	 value	of  apply(Fun,
	      Args) after an attempt has been made to autoload Module. If this
	      is not possible, the call	fails with exit	reason undef.

NOTES
       The code	in error_handler is complex and	should not be changed  without
       fully understanding the interaction between the error handler, the init
       process of the code server, and the I/O mechanism of the	code.

       Changes in the code which may seem small	can cause a  deadlock  as  un-
       foreseen	 consequences may occur. The use of input is dangerous in this
       type of code.

Ericsson AB			  kernel 3.2		      error_handler(3)

NAME | DESCRIPTION | EXPORTS | NOTES

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=error_handler&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help