-
Notifications
You must be signed in to change notification settings - Fork 207
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
Conversation
.swiftpm/xcode/xcshareddata/xcschemes/SwiftyDropbox-Package.xcscheme
Outdated
Show resolved
Hide resolved
- SwiftyDropbox (10.0.0) | ||
- SwiftyDropboxObjC (10.0.0): | ||
- SwiftyDropbox (~> 10.0.0) | ||
- SwiftyDropbox (10.1.0) |
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.
Unclear if we want this?
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.
i think it's probably safe to keep
} | ||
} | ||
|
||
func registerGlobalErrorHandler(_ callback: @escaping (CallError<Any>) -> Void, queue: OperationQueue = .main) { |
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.
Let’s include a corresponding deregister call to ensure completeness
Source/SwiftyDropbox/Shared/Handwritten/GlobalErrorResponseHandler.swift
Outdated
Show resolved
Hide resolved
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.
Awesome, thank you @jboulter11 🙏🏼
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