Exceptions: Difference between revisions

308 bytes added ,  21 December 2007
note about 'return rv' pattern
m (clarifying title)
(note about 'return rv' pattern)
Line 14: Line 14:


This is probably a bug, so we want a tool that can find and flag all of these results. After the bugs are fixed, any remaining call sites that really should ignore failures can be rewritten automatically to ignore exceptions.
This is probably a bug, so we want a tool that can find and flag all of these results. After the bugs are fixed, any remaining call sites that really should ignore failures can be rewritten automatically to ignore exceptions.
Note that the following pattern is '''not''' an ignored nsresult return value:
  rv = callMethod();
  return rv;
This pattern can be rewritten to use exceptions (by simply letting any exceptions propagate up to the caller) with the techniques described in the section on making call sites exception safe.


=== Analysis to detect ignored return values ===
=== Analysis to detect ignored return values ===
313

edits