Applications which consist of several separate components and/or which use components or packages of other software tend to lack cohesive error handling due to the separate "error domains" owned by each component. The Unified Error Handler (UEH) alleviates this problem by fitting all component error domains into one overall error domain and prevents collisions between the same error "codes" from different components. This allows easier error handling in the calling code and provides a mechanism for error "passthrough" from situations such as: component A calls component B calls component C, which generates and error condition. B's operation fails as a result and passes C's error code back to A so that the ultimate cause of the problem can be discerned, even if A doesn't know about C. B also can return its own error condition code on an error stack so that A can attempt alternate processing depending upon the type of failure in B, regardless of the ultimate failure in C.
Despite its name, UEH can be used to do any kind of status notifications - not only errors. For instance, warnings, hints, and informational status can be passed.
Note that UEH could also mean "Unified Exception Handler" since UEH is independant of the method for passing errors back to calling code. In the case of C++, an exception handler which knows about UEH can be written and can be thrown, thus passing UEH-compliant error codes to the caller.
The way UEH works is that every component you write is assigned a unique 4-byte integer value, called a facility code. Errors are passed using a Unified Error Code (UEC), which consists of the facility code and a 4-byte integer condition code. Facility codes are absolutely unique: anyone wishing to produce software which is UEH-compliant must obtain a facility code for each component. The process is simple and free: send email with a body consisting of three lines:
where "count" is the number of facility codes you want to allocate and "entity" is your name, or the name of your company. You can request as many facility codes as you wish, but no more than ten (10) at a time per individual, or 100 at a time for a company/organization. Your request will be processed and your unique facility codes will be assigned to you. You will receive an email informing you as to the codes that have been assigned to you. For a list of currently assigned facility codes, click here.
Why not assign facility code dynamically? Several reasons:
Downloads (Last update: 29-March-2002)
A Windows 95/98/ME/XP/NT/2000 implementation of the UEH manager is available here for download: UEH32 V1.2. The file is a self-extracting archive containing the DLL and documentation. It also contains the UEHErr program which can be used to translate error codes. Sources are also available. This software is released to the public domain. UEH32 is compliant with version 1.2 of the UEH specification.
The UEH specification
UEH is a component of the Application Foundation, hosted on