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

Add a global error handler focused on non-route errors #436

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

jboulter11
Copy link
Contributor

Summary

Adds unfair lock utility class which we love in the Dropbox codebase.

Adds global error response handler which type-erases route errors so we can have simple global error handling.

We are adding this due to a need to handle auth error responses globally.

Test Plan

Unit tests, integration tests incoming

@jboulter11 jboulter11 marked this pull request as ready for review December 6, 2024 23:36
- SwiftyDropbox (10.0.0)
- SwiftyDropboxObjC (10.0.0):
- SwiftyDropbox (~> 10.0.0)
- SwiftyDropbox (10.1.0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear if we want this?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's probably safe to keep

}
}

func registerGlobalErrorHandler(_ callback: @escaping (CallError<Any>) -> Void, queue: OperationQueue = .main) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s include a corresponding deregister call to ensure completeness

Copy link

@shaunfowler shaunfowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you @jboulter11 🙏🏼

@jboulter11 jboulter11 merged commit 5221b64 into master Dec 10, 2024
2 checks passed
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.

3 participants