|
Every application should implement consistent error handling that communicates information clearly back to the user and also records all necessary information for support and debugging. Yet how many of us have the time to do this correctly? To help developers solve this problem once and for all, QCGU offers an error managing framework that lets you define the error categories and errors for use in your application, raise and handle errors using a pre-defined and sophisticated runtime error package, and analyze errors with the QCGU Runtime Monitor.
The first thing to do is define your error categories and errors through the QCGU interface. Here is an example of an error definition. Notice the use of substitution variables in both the error message and help text. QCGU will automatically replace these variables with context-specific values you provide in your call to the qd_runtime error handler program.

And rather than write complex code each time you need to raise or handle an error, you can take advantage of pre-defined scripts to do most of the coding work for you. If, for example, you are writing a program that performs DML (insert, update or delete), the QCGU Development Architecture script set provides a large quantity of handlers for the common errors you would expect to encounter, and it offers a depth of error handling logic that you are unlikely to perform yourself.
In the screen shot below, you can see just a portion of the code that is run when Oracle encounters the ORA-1400 error, such as:
ORA-01400: cannot insert NULL into ("SCOTT"."EMP2"."EMPNO")

All of the error raising and handling logic is consolidated into a single QCGU Deployment package, qd_runtime, which means that the learning curve for working with this functionality is relatively small.
And when your application does encounter errors, writing out the information to the various QCGU Deployment tables, you can use the QCGU Runtime Monitor to view that data.
QCGU can't take care of all your error needs automatically, but if you choose to follow the QCGU Development Architecture, you will be able to...
- Spend much more of your time on application-specific logic;
- Spend much less time on low-level "plumbing" like basic error logging and reporting;
- Quickly analyze and resolve errors when they occur.
|