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

Major ✨ Typed Throws #149

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Major ✨ Typed Throws #149

merged 3 commits into from
Nov 22, 2024

Conversation

MadsBogeskov
Copy link
Contributor

This changes the async API from returning a Result to instead returning the success value and then just throw any error. This is acceptable now that the throw should provide type safety in almost all situations. (async calls embedded in completion blocks being the exception where the Error for some compiler-reason is erased:

func someApi(completion: () -> Void) {
  Task {
    do {
    try await someApi()
    } catch {
       // the error is just an any Error here for some reason.
    } 
  }
}

Copy link

github-actions bot commented Nov 21, 2024

Test Results

60 tests   60 ✅  3s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 9b8b9dd.

♻️ This comment has been updated with latest results.

@MadsBogeskov MadsBogeskov marked this pull request as ready for review November 21, 2024 12:33
@MadsBogeskov MadsBogeskov enabled auto-merge (squash) November 21, 2024 12:33
@MadsBogeskov MadsBogeskov merged commit 17eeeac into main Nov 22, 2024
3 checks passed
@MadsBogeskov MadsBogeskov deleted the typed_throws branch November 22, 2024 06:29
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