-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate I/O errors from filesystem and serialization failures #28
Conversation
d7ebdf4
to
5c2e4b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left one comment
5c2e4b7
to
61605f7
Compare
Thanks again! I think I fixed the issue, but I didn't quite understand this part:
Let me know if the updated PR does what you were looking for — I wasn't 100% sure what you meant there. |
Forgot to update |
Previously, I/O and serialization/deserialization errors were silently swallowed. This commit makes use of the NSFileHandle APIs on iOS 13 and later to perform filesystem operations and propagate the errors to the caller. The following APIs are now deprecated in favor of the variants that take a (nullable) `NSError **`: ``` -[CASQueueFile add:] -[CASQueueFile peek:] -[CASQueueFile pop:] -[CASQueueFile clear] -[CASObjectQueue add:] -[CASObjectQueue peek:] -[CASObjectQueue pop:] -[CASObjectQueue clear] ``` In addition, the two convenience methods `-peek` and `-pop` to access a single element are deprecated since there is no way to distinguish an empty queue from an error: ``` -[CASObjectQueue peek] -[CASObjectQueue pop] ``` Use `-peek:error:` and `-pop:error:` instead, and call `-firstObject` on the result if you don't need to distinguish an empty queue from an error.
…pport new NSFileHandle APIs
4e302ac
to
b17708b
Compare
Thanks for doing this! Adding proper error handling has been a long-standing TODO :) |
Glad to help! I have a few more little features coming for you. :) |
This PR fixes #7 .
Previously, I/O and serialization/deserialization errors were silently
swallowed.
This commit makes use of the NSFileHandle APIs on iOS 13 and later to
perform filesystem operations and propagate the errors to the caller.
The following APIs are now deprecated in favor of the variants that take
a (nullable)
NSError **
:In addition, the two convenience methods
-peek
and-pop
to accessa single element are deprecated since there is no way to distinguish
an empty queue from an error:
Use
-peek:error:
and-pop:error:
instead, and call-firstObject
on the result if you don't need to distinguish an empty queue from an
error.
I also bumped the Azure Xcode version to Xcode 12 so CI builds with the new APIs.