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

TOOL_ERR built-in package examples

TOOL_ERR.CODE built-in function

TOOL_ERR.ENCODE built-in function

TOOL_ERR.MESSAGE built-in function

TOOL_ERR.NERRORS built-in function

TOOL_ERR.POP built-in procedure

TOOL_ERR.TOOL_ERROR built-in exception

TOOL_ERR.TOPERROR built-in constant

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.

See also

Built-in packages examples

About the TOOL_ERR built-in package

TOOL_ERR built-in package