
set_error_handler(+Number, ++PredSpec)

   Set an error handler PredSpec for the error with number Number.



Arguments
   Number              Integer.
   PredSpec            Term of the form Atom/Integer.

Type
   Obsolete

Description
   Assigns the procedure specified by PredSpec (specified as name/arity) as
   the error handler for the error whose number is given by Number.


   An error handler such as PredSpec can have 3 optional arguments:  the
   1st argument is the number of the error; the 2nd argument is the culprit
   (a structure corresponding to the call which caused it); the 3rd is the
   context module or a free variable (if the module is unknown).  The error
   handler is free to use less than 3 arguments.


   The errors which exist are implementation defined.




Modes and Determinism
   set_error_handler(+, ++) is det

Modules
   This predicate is sensitive to its module context (tool predicate, see @/2).

Exceptions
     4 --- Either Number or PredSpec is not instantiated.
     5 --- Number is not an integer.
     5 --- PredSpec is not of the form Atom/Integer.
     6 --- Number is not a valid error number.
     6 --- PredSpec is of the form Atom/Integer, but the integer is    greater than 3.
    60 --- PredSpec is of the form Atom/Integer, but no such predicate    has been defined.

Examples
   
Success:
      [eclipse]: string_list(S,L).
      instantiation fault in string_list(_g50, _g52)
      [eclipse]: get_error_handler(4,M,N).
      M = error_handler/2
      N = sepia_kernel
      yes.
      [eclipse]: set_error_handler(4,true/0), string_list(S,L).
      S = _g56
      L = _g58
      yes.

      [eclipse]: [user].
       a :- write(warning_output, "typo"), fail.
       user compiled 100 bytes in 0.03 seconds
      [eclipse]: set_error_handler(5,a/0).
      yes.
      [eclipse]: atom_length("atom",L).
      typo
      no.

Error:
      set_error_handler(N,true/0).   (Error 4).
      set_error_handler(5,P).        (Error 4).
      set_error_handler(5.0,true/0). (Error 5).
      set_error_handler(1000,X).     (Error 6).
      set_error_handler(-1,X).       (Error 6).
      set_error_handler(6,a/4).      (Error 6).  % arity > 3.
      set_error_handler(6,t/2).      (Error 60). % no t/2.





See Also
   set_event_handler / 2, get_error_handler / 3
