$$NEWERR |
This is an extrinsic function to report if the
current platform supports the new standard error trapping. It always returns
1.
All current VA systems support the new error trapping standard. The SACC has
being changed to allow the use of $ESTACK, $ETRAP, $ECODE There are still
inconsistency when mixing the old and new error trapping.
To set a new trap:
N $ESTACK,$ETRAP S $ETRAP="D ERROR^XXX" or
N $ESTACK,$ETRAP S $ETRAP="S $EC="""" Q -1"
These are still valid. Usage to set new trap:
N $ESTACK,$ETRAP S $ETRAP="D ERROR^XXX"
Usage to set old style trap:
N $ESTACK,$ETRAP S $ETRAP=""
S X="ERROR^YYY",@^%ZOSF("TRAP")
The vendors differ in how they support the mixing of old and new forms of
error trapping. A common way is to look at the current stack frame and, if it
finds the old form, it uses that; otherwise it looks for the new style. This
gives the old style a local scope of the current stack level.
|
|
UNWIND |
This entry point is used after a package error trap
to quit back to the calling routine. Control returns to the level above the
one that NEWED $ESTACK.
MAIN S X=1 D SUB
W X
Q SUB N $ESTACK,$ETRAP S $ETRAP="D ERROR"
S X=1/0
Q
Usage: ERROR D ^%ZTER ;This will record the error info and clear $ECODE
S ^XXX="Incomplete record"
G UNWIND^%ZTER
|
|
%ZTER |
This routine can be called from the top DO ^%ZTER to
record the variables at the current time into the error trap. This will clear
$ZE and $ECODE.
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
%ZT |
Input |
(optional) The %ZT array can be used to identify a
global node whose descendents should be recorded in the error log. When called
within the standard Kernel error trap, %ZT is set to record the user's
location in the menu system.
>S %ZT("^TMP($J)")=""
>D ^%ZTER
|
|
APPERROR |
This entry will point allow developers to pass-in the
error message that will be displayed in the error trap listing.
Usage: D APPERROR^%ZTER("My App Error")
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
%ZT |
Input |
The same as calling %ZTER.
|
|