CustomerInfoManager/OfferingsManager: improved display of underlying errors#1888
Merged
Conversation
…ing errors Improved these 2 logs: > 🍎‼️ Error fetching offerings - The operation couldn’t be completed. (RevenueCat.OfferingsManager.Error error 0.) Underlying error: The operation couldn’t be completed. (RevenueCat.BackendError error 0.) >⚠️ Attempt to update CustomerInfo from network failed. The operation couldn’t be completed. (RevenueCat.BackendError error 0.) These 2 now will display the underlying `NetworkError` instead of the opaque "(RevenueCat.BackendError error 0.)".
tonidero
approved these changes
Sep 7, 2022
|
|
||
| fileprivate var underlyingError: Error? { | ||
| switch self { | ||
| case let .backendError(.networkError(error)): return error |
Contributor
There was a problem hiding this comment.
Should we use the underlyingError of the BackendError here?
Contributor
Author
There was a problem hiding this comment.
That's not defined, but it could be another way to handle this yeah.
I'd say for now we don't need to expose that for anything else so this is a bit more direct, but we could change it in the future.
NachoSoto
commented
Sep 7, 2022
|
|
||
| fileprivate var underlyingError: Error? { | ||
| switch self { | ||
| case let .backendError(.networkError(error)): return error |
Contributor
Author
There was a problem hiding this comment.
This is why typed errors are amazing.
|
|
||
| fileprivate var underlyingError: Error? { | ||
| switch self { | ||
| case let .backendError(.networkError(error)): return error |
Contributor
Author
There was a problem hiding this comment.
That's not defined, but it could be another way to handle this yeah.
I'd say for now we don't need to expose that for anything else so this is a bit more direct, but we could change it in the future.
NachoSoto
pushed a commit
that referenced
this pull request
Sep 8, 2022
**This is an automatic release.** ### Bugfixes * `watchOS`: fixed crash when ran on single-target apps with Xcode 14 and before `watchOS 9.0` (#1895) via NachoSoto (@NachoSoto) * `CustomerInfoManager`/`OfferingsManager`: improved display of underlying errors (#1888) via NachoSoto (@NachoSoto) * `Offering`: improved confusing log for `PackageType.custom` (#1884) via NachoSoto (@NachoSoto) * `PurchasesOrchestrator`: don't log warning if `allowSharingAppStoreAccount` setting was never explicitly set (#1885) via NachoSoto (@NachoSoto) * Introduced type-safe `PurchasesError` and fixed some incorrect returned error types (#1879) via NachoSoto (@NachoSoto) * `CustomerInfoManager`: fixed thread-unsafe implementation (#1878) via NachoSoto (@NachoSoto) ### New Features * Disable SK1's `StoreKitWrapper` if SK2 is enabled and available (#1882) via NachoSoto (@NachoSoto) * `Sendable` support (#1795) via NachoSoto (@NachoSoto) ### Other Changes * Renamed `StoreKitWrapper` to `StoreKit1Wrapper` (#1886) via NachoSoto (@NachoSoto) * Enabled `DEAD_CODE_STRIPPING` (#1887) via NachoSoto (@NachoSoto) * `HTTPClient`: added `X-Client-Bundle-ID` and logged on SDK initialization (#1883) via NachoSoto (@NachoSoto) * add link to SDK reference (#1872) via Andy Boedo (@aboedo) * Added `StoreKit2Setting.shouldOnlyUseStoreKit2` (#1881) via NachoSoto (@NachoSoto) * Introduced `TestLogHandler` to simplify how we test logged messages (#1858) via NachoSoto (@NachoSoto) * `Integration Tests`: added test for purchasing `StoreProduct` instead of `Package` (#1875) via NachoSoto (@NachoSoto) * `ErrorUtils`: added test to verify that returned errors can be converted to `ErrorCode` (#1871) via NachoSoto (@NachoSoto)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improved these 2 logs:
These 2 now will display the underlying
NetworkErrorinstead of the opaque "(RevenueCat.BackendError error 0.)".