Skip to content
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

Allow transaction updateBlock to return Error instead of NSError #45

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

darinf
Copy link

@darinf darinf commented Mar 9, 2024

Unfortunately Error > NSError > Error is lossy on Windows.

enum MyErrorType: Error {
  case someError
}

Given code such as the above, if you convert an instance of MyErrorType to NSError, the result is no longer an instance of MyErrorType. This does not happen on Apple platforms.

This causes issues when trying to propagate an error generated from runTransaction's updateBlock to the caller of runTransaction.

A solution is to just use Error instead of NSError in the API.

@darinf darinf changed the title WIP Allow runTransaction's updateBlock to return an Error instead of NSError Mar 11, 2024
@darinf darinf changed the title Allow runTransaction's updateBlock to return an Error instead of NSError Allow transaction updateBlock to return Error instead of NSError Mar 11, 2024
@darinf darinf requested a review from fiedukow March 11, 2024 17:30
@darinf darinf marked this pull request as ready for review March 11, 2024 17:30
@fiedukow
Copy link

nice find

@darinf darinf merged commit 517c18c into main Mar 11, 2024
2 checks passed
@darinf darinf deleted the darin/fix-error-propagation branch March 11, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants