
traperror - trapping errors

Calling sequence:
traperror(expr)

Parameter:

expr   --  expression

Summary:

traperror intercepts errors caused by system functions or the function error .
In general, an evaluation is completely aborted if an error occures and the
interactive level is entered.  This does not happen when an error occures
during the evaluation of the argument expr of traperror.

An error occuring during the evaluation of expr causes only the evaluation
of expr to be aborted and the call of traperror to be entered. In case of an
error traperror then returns an error code, which is a positive integer. If no
error occurs traperror returns the value 0. traperror is a kernel function.

>>   a := 1/x: traperror(subs(a, x=0));

     1025

>>  traperror((error("My error");1/0));

      1028

>>  x:= 0: traperror((x:= 1/x)), x;

      1025, 0

See also:  error

