Rule Definition
Exceptions or errors can lead to erroneous program behavior if they are not properly handled.
Violation Code Sample
NSError *error;
[self trySomethingWithError:&error];
if (error) {
// Handle Error
Fixed Code Sample
NSError *error;
if (![self trySomethingWithError:&error]) {
// Handle Error
}
Reference
https://github.com/NYTimes/objective-c-style-guide#error-handling
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html#//apple_ref/doc/uid/TP40001806-CH204-SW1
Related Technologies
Technical Criterion
Programming Practices - Error and Exception Handling
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.