brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.64k stars 2.3k forks source link

Improve error messaging for SKUs SDK #28991

Open AlanBreck opened 1 year ago

AlanBreck commented 1 year ago

Description

Currently there's not a great way to determine different types of errors when interacting with the SKUs SDK. For instance, when attempting to link a receipt to two different email addresses using the sdk.submit_receipt method, it returns a 400, but apart from parsing the message, there's no way to distinguish this error from any other error. As a result, it's more challenging for the UI on account.brave.com to provide the user with relevant error messages.

bsclifton commented 1 year ago

This information SHOULD be there - we'll just need to display in the accounts website

AlanBreck commented 1 year ago

This information SHOULD be there - we'll just need to display in the accounts website

Yes, but the information is still in the message. While we can use that as a stop gap, this issue is in hopes of an ideal solution where the errors objects are more robust.

For instance, when attempting to link a receipt to two different email addresses using the sdk.submit_receipt method, it returns a 400, but apart from parsing the message, there's no way to distinguish this error from any other error.