Rules and Standards |
CAA V5 Error Processing RulesRules, hints, and tips to manage error processing |
|
Technical Article |
AbstractThis article explains how to create your own error objects and messages, and how to process the errors returned by the methods you call. |
The V5 frameworks deal with four ways of handling errors:
Notes:
CATThrow
macro. When C++ exceptions are
discussed, they are referred to as C++ native exceptions.CXX_EXCEPTION=
[Top]
The following rules must be applied:
[Top]
The framework border that must use HRESULT is made of:
The remaining part of the framework border that cannot use HRESULT is made of:
This rule is declined as follows:
The error management process that this rule implies is:
CATReturnError
with the received CATError and
possibly change the CATError message CATReturnError
after having released the received
CATError and created a new CATError (more expensive)Even if the failure can be fixed, such as just ignoring an item in a
loop, there are problems you may want to log because something wrong
happens that needs to be investigated. In these cases, use CATSysLogError
.
CATSysLogAbend
. (This call will make a
core dump at DS and will continue after having logged the error in the abend
trace at customer’s location.) Because the call doesn't make a core
dump at customer’s locations, you need to manage the error as if it
were not a major error as described above.Note: there is not always a CATError when a method you call fails.You must check the CATError availabilty
CATSysLogAbend
. (This
call will make a core dump at DS and continue after having logged the
error in the abend trace at customer’s location.) Because the call
doesn't make a core dump at customer’s locations, you need to manage
the error as if it were not a major error as described above.[Top]
This rule implies that:
[Top]
This rule implies to either:
Build
,
Init
, or Start
method, and in a Stop
method or in some already existing methods
class CATDimBoolean : public CATBaseUnknown { CATDimBoolean(); virtual ~CATDimBoolean(); HRESULT Start(); HRESULT Stop(); HRESULT SomeExistingMethod(); } |
[Top]
The following table shows differences between these three ways of managing errors.
V5 Exceptions | C++ Native Exceptions | HRESULT | |
---|---|---|---|
Compatibility between Softwares | No | Weak | Yes |
Distribution Support | No/Not authorized | CORBA only/Not authorized | Yes |
Thread Support | Yes | Yes | Yes |
Performance | Medium | Low | High |
Easy Programming | Yes | Yes | No |
Automatic Object Lifecycle Management | No | Yes | No |
64-bit support | No (to do) | Depends on provider | Yes |
Traceability | Bad | No | No |
Signature Checked by Compiler | No | Yes | No |
Optimizer | No | Yes | Yes |
Debug | Yes | No | No |
[Top]
Version: 1 [Nov 2001] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.