Language Ref Manual references: 11.4 Exception Handling, 11 Exceptions
|
In this section... 7.5.1 Predefined Exceptions 7.5.2 Constraint_Error and Numeric_Error7.5.3 Implementation-Defined Exceptions |
| Summary of Guidelines from this section |
Language Ref Manual references: C Predefined Language Environment
Constraint_Error and Numeric_ErrorNumeric_Error exceptions with a Numeric_Error | Constraint_Error exception handler.
Numeric_Error and
Constraint_Error.
Numeric_Error may be raised, an implementation is allowed to
raise Constraint_Error instead. In fact, there is no requirement that an
implementation raise the same exception under the same circumstances. It is
not enough to replace the Numeric_Error exception with a Constraint_Error.
Either one may be raised; and if Numeric_Error is raised, it will not be
caught with a simple Constraint_Error exception handler.Language Ref Manual references: 11.1 Exception Declarations, 11.2 Exception Handlers, C Predefined Language Environment
If you create interface packages for the implementation-specific portions of your program, those packages can catch or recognize implementation specific exceptions and convert them into user-defined exceptions that have been declared in the specification. Do not allow yourself to be forced to find and change the name of every handler you have written for these exceptions when the program is ported.
Language Ref Manual references: 11.1 Exception Declarations, 11.2 Exception Handlers, 11.3 Raise Statements