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

Generic API Error Handling #47

Merged

Conversation

Tanz0rz
Copy link
Collaborator

@Tanz0rz Tanz0rz commented Apr 16, 2024

We can return them in the collapsed view too if that is better. Right now, the new lines and whitespace are formatted in. Here is an example using the swap example file:

Failed to get swap data: processing response failed: {
    "description": "Not enough 0x853d955acef822db058eb8505911ed77f175b99e balance. Amount: 1000000000000000000. Balance: 0",
    "error": "Bad Request",
    "meta": [
        {
            "type": "fromTokenAddress",
            "value": "0x853d955acef822db058eb8505911ed77f175b99e"
        },
        {
            "type": "amount",
            "value": "1000000000000000000"
        },
        {
            "type": "fromTokenBalance",
            "value": "0"
        }
    ],
    "requestId": "8b78c4b7-e9e1-46e2-84fa-457c26c1c275",
    "statusCode": 400
}

@EnoRage
Copy link
Contributor

EnoRage commented Apr 17, 2024

@Tanz0rz can you fix the unit tests?

Copy link
Contributor

@EnoRage EnoRage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's fix the tests and merge

@Tanz0rz Tanz0rz merged commit 965b60b into patch-aggregation-sdk Apr 17, 2024
2 checks passed
@Tanz0rz Tanz0rz deleted the patch-aggregation-sdk-generic-error-handling branch April 17, 2024 22:04
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.

2 participants