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 in check for billing error #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ltirrell
Copy link

@ltirrell ltirrell commented Jun 21, 2023

Previously, a 402 status code was not specifically handled, and give a cryptic error message.

This may not be the best Error type or message. I used the message from this dict returned by _handle_response() when a 402 status occurred:

{
    "error": {
        "errorType": "BILLING_ERROR",
        "name": "PaymentRequired",
        "msg": "Please add a valid payment method at https://flipsidecrypto.xyz/api to continue using the Flipside SDK/API. If you have already added a credit card you may be seeing this message due to a failed payment (please check the status of your account at https://flipsidecrypto.xyz/api).",
    },
    "data": None,
    "status": "error",
}

Here is an example tracebackfor what the error looks like without catching a 402.
traceback.txt

@vercel
Copy link

vercel bot commented Jun 21, 2023

@ltirrell is attempting to deploy a commit to the Flipside Crypto Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant