Navigation: ABC Library Reference > ErrorClass > ErrorClass Methods >====== Throw (process specified error) ====== | ![]() ![]() |
Throw( error id ), PROC
| Throw | Processes the specified error then returns its severity level. |
| error id | An integer constant, variable, EQUATE, or expression that indicates which error to process. |
The Throw method processes the specified error by calling other ErrorClass methods, then returns its severity level.
Typically, Throw is the method your program calls when it encounters a known error. That is, as your program encounters errors or other notable conditions, it simply calls the Throw method or one of its variations (ThrowFile or ThrowMessage), passing it the appropriate error id. Throw then calls any other ErrorClass methods required to handle the specified error.
Implementation:
The Throw method saves the error state (ERROR, ERRORCODE, FILEERROR, and FILEERRORCODE), locates the specified error, calls the appropriate method to handle the error according to its severity level, then returns the severity level.
The ABERROR.INC file contains a list of default symbolic constants for the error id parameter.
The Throw method may or may not RETURN to your calling program, depending on the severity of the error.
Return Data Type: BYTE
Example:
!user level error occurred. ask user to confirm
Severity = GlobalErrors.Throw(Msg:ConfirmCancel) !handle the error condition
IF Severity = Level:Cancel
LocalResponse = RequestCancelled
DO ProcedureReturn
END
See Also: Errors, ThrowFile, ThrowMessage






