ably / ably-cocoa

iOS, tvOS and macOS Objective-C and Swift client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
46 stars 25 forks source link

Make sure we short-circuit on non-nil NSError** #608

Open tcard opened 7 years ago

tcard commented 7 years ago

I've spotted a couple of places where we don't properly short-circuit when an error occurs, and instead we attempt to go on as if everything went right. For example, here.

To avoid littering the code with Go-style if (err) return;, maybe we can use a macro to act as "monadic do". It's probably not worth it, though.

┆Issue is synchronized with this Jira Bug by Unito

QuintinWillison commented 3 years ago

The example is helpful, but this sounds like we need to do an audit of key methods where anything approaching that pattern is in use. Reclassifying as a bug.