950
A language can be used which requires, at compile time, to catch all serious exceptions.
However, one must make sure to use the most current version of the API as new exceptions
could be added.
Phase: Implementation
Catch all relevant exceptions. This is the recommended solution. Ensure that all exceptions are
handled in such a way that you can be sure of the state of your system at any given moment.
Demonstrative Examples
Example 1:
The following code excerpt ignores a rarely-thrown exception from doExchange().
Example Language: Java (Bad)
try {
doExchange();
}
catch (RareException e) {
// this can never happen
}
If a RareException were to ever be thrown, the program would continue to execute as though
nothing unusual had occurred. The program records no evidence indicating the special situation,
potentially frustrating any later attempt to explain the program's behavior.
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
Nature Type ID Name Page
MemberOf 388 7PK - Errors 700 2322
MemberOf 728 OWASP Top Ten 2004 Category A7 - Improper Error
Handling
711 2337
MemberOf 743 CERT C Secure Coding Standard (2008) Chapter 10 -
Input Output (FIO)
734 2347
MemberOf 746 CERT C Secure Coding Standard (2008) Chapter 13 -
Error Handling (ERR)
734 2350
MemberOf 876 CERT C++ Secure Coding Section 08 - Memory
Management (MEM)
868 2376
MemberOf 877 CERT C++ Secure Coding Section 09 - Input Output
(FIO)
868 2377
MemberOf 880 CERT C++ Secure Coding Section 12 - Exceptions and
Error Handling (ERR)
868 2379
MemberOf 962 SFP Secondary Cluster: Unchecked Status Condition 888 2400
MemberOf 1159 SEI CERT C Coding Standard - Guidelines 05. Floating
Point (FLP)
1154 2457
MemberOf 1167 SEI CERT C Coding Standard - Guidelines 12. Error
Handling (ERR)
1154 2461
MemberOf 1171 SEI CERT C Coding Standard - Guidelines 50. POSIX
(POS)
1154 2463
MemberOf 1181 SEI CERT Perl Coding Standard - Guidelines 03.
Expressions (EXP)
1178 2466
MemberOf 1405 Comprehensive Categorization: Improper Check or
Handling of Exceptional Conditions
1400 2531
Notes
CWE Version 4.14
CWE-392: Missing Report of Error Condition
CWE-392: Missing Report of Error Condition