A script-enabled browser is required for this page to function properly.

About the TOOL_ERR Package

Description

In addition to using exceptions to signal errors, some Built-in packages (e.g., the DDEBUG package) provide additional error information. This information is maintained in the form of an "error stack".

The error stack contains detailed error codes and associated error messages. Errors on the stack are indexed from zero (oldest) to n-1 (newest), where n is the number of errors currently on the stack. Using the services provided by the TOOL_ERR package, you can access and manipulate the error stack.

Tool_ERR Constructs Example

The following procedure shows how you can use constructs within the TOOL_ERR package to handle errors generated by the Debug.Interpret Built-in:


PROCEDURE error_handler IS
/* Call a Built-in that interprets a command */
BEGIN 
   Debug.Interpret('.ATTACH LIB LIB1'); 
EXCEPTION
/* 
** Check for a specific error code, print the 
** message, then discard the error from the stack
** If the error does not match, then raise it.
*/ 
  WHEN OTHERS THEN 
    IF Tool_Err.Code = Tool_Err.Encode('DEPLI',18) THEN
      Text_IO.Put_Line(Tool_Err.Message);
      Tool_Err.Pop; 
    ELSE
      RAISE; 
   END IF;
END;

If the exception handling code did not make use of TOOL_ERR constructs, you would have received an error alert displaying the message PDE-PLI018: Could not find library LIB1. Using TOOL_ERR constructs, the error is caught and the message is sent to the Interpreter.

Procedures and Functions

Tool_Err.Clear

Tool_Err.Code

Tool_Err.Encode

Tool_Err.Message

Tool_Err.Nerrors

Tool_Err.Pop

Tool_Err.Tool_Error

Tool_Err.Toperror