ErrorCode.unknownBackendError: include original error code#2032
Merged
Conversation
NachoSoto
added a commit
that referenced
this pull request
Nov 7, 2022
See https://github.com/RevenueCat/khepri/pull/4716 This makes that error `ErrorCode.invalidReceiptError` instead of `.unknownBackendError`. I've also added #2032 to improve error messages when these errors are unknown in the future.
NachoSoto
added a commit
that referenced
this pull request
Nov 8, 2022
See https://github.com/RevenueCat/khepri/pull/4716 This makes that error `ErrorCode.invalidReceiptError` instead of `.unknownBackendError`. I've also added #2032 to improve error messages when these errors are unknown in the future.
0787b8a to
69ee7fd
Compare
Currently we only include the message and not the error code. So when these unknown errors are returned, unless the message is clear, we might not known which code the backend actually sent. Example: > There was an unknown backend error. The purchased product was missing in the receipt. This is typically due to a bug in StoreKit. In this case it's clear, but nowhere in the logs we can find the error code. This adds the error code to those messages (only when the code is unknown), as well as to `userInfo`. ### Examples from the tests #### Before: > There was an unknown backend error. This is a future unknown error #### After: > There was an unknown backend error. This is a future unknown error (1234) #### Before: > 😿‼️ There was an unknown backend error. Page not found #### After: > 😿‼️ There was an unknown backend error. Page not found (6000)
69ee7fd to
e74d86c
Compare
vegaro
approved these changes
Nov 11, 2022
vegaro
left a comment
Member
There was a problem hiding this comment.
This is going to be very useful
NachoSoto
pushed a commit
that referenced
this pull request
Nov 18, 2022
**This is an automatic release.** ### Bugfixes * `StoreKit 2`: don't finish transactions in observer mode (#2053) via NachoSoto (@NachoSoto) ### Other Changes * `CircleCI`: added ability to create a release manually (#2067) via NachoSoto (@NachoSoto) * Changelog: Fix links to V4 API Migration guide (#2051) via Kevin Quisquater (@KevinQuisquater) * `HTTPClient`: added log for failed requests (#2048) via NachoSoto (@NachoSoto) * `ErrorResponse.asBackendError`: serialize attribute errors as `NSDictionary` (#2034) via NachoSoto (@NachoSoto) * `ErrorCode.unknownBackendError`: include original error code (#2032) via NachoSoto (@NachoSoto) * `CI`: fixed `push-pods` job (#2045) via NachoSoto (@NachoSoto) * `PostReceiptDataOperation`: log Apple error when purchase equals expiration date (#2038) via NachoSoto (@NachoSoto) * Update Fastlane plugin (#2041) via Cesar de la Vega (@vegaro)
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.
Currently we only include the message and not the error code. So when these unknown errors are returned, unless the message is clear, we might not known which code the backend actually sent.
Example:
In this case it's clear, but nowhere in the logs we can find the error code.
This adds the error code to those messages (only when the code is unknown), as well as to
userInfo.Examples from the tests
Before:
After:
Before:
After: