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

feat: revamp provider error handling #511

Merged
merged 1 commit into from
Dec 5, 2023
Merged

Conversation

xJonathanLEI
Copy link
Owner

Greatly simplify provider error code matching. Previously, the error code returned from the RPC is an enum with 2 variants for known and unknown codes to accommodate the fact that JSON-RPC nodes sometimes return codes that are part of the JSON-RPC standard, but are not from the Starknet specifications. This commit changes to move the unknown codes to be handled by the implementation-specific error type instead, making it much easier to match against specification error codes, at the cost of being harder to match the unknown codes.

Greatly simplify provider error code matching. Previously, the error
code returned from the RPC is an enum with 2 variants for known and
unknown codes to accommodate the fact that JSON-RPC nodes sometimes
return codes that are part of the JSON-RPC standard, but are not from
the Starknet specifications. This commit changes to move the unknown
codes to be handled by the implementation-specific error type instead,
making it much easier to match against specification error codes, at the
cost of being harder to match the unknown codes.
@xJonathanLEI xJonathanLEI merged commit 4107312 into master Dec 5, 2023
24 checks passed
@xJonathanLEI xJonathanLEI deleted the dev/provider_error branch December 5, 2023 05:00
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