DP-2—Status Ignored After Call
Defect Indicators: An exception is suppressed or the error status returned by a called program is ignored. Example indicators are:
- C: Any call to a file system routine where the result is not checked.
- SQL: Any command not immediately followed by a check on the SQL state variable.
- C++/Java: An empty statement block following a catch.
Risks: A program may fail silently, in other words, it will continue processing when it should have stopped, with potentially disastrous consequences, such as data corruption or loss.
Transient information important for tracing the source of the error is lost, making debugging difficult if not impossible.
- For each of the program and subsystem calls made by program, check to see how the status resulting from the call is used. If it is ignored or suppressed without explanation, mark the call.
- Put in code to perform error handling immediately following any call to other programs or subsystems.
- In code where exception handling is used, be specific as to which exceptions, if any, should be caught.
39% of errors caused by interfacing:
39% of all errors are caused by internal interface errors / errors in communication between routines.