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

RPC omit errors when empty #124

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

Stefan-Ethernal
Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal commented Dec 3, 2024

When there is a successful response on the certain RPC function, the error field (with nil value) is present in the JSON response. This causes issue with Foundry, when trying to deserialize it.

Deserialization Error: invalid type: null, expected struct JsonRpcError at line 1 column 140. 
Response: {"jsonrpc":"2.0","id":1,"result":{"uptime":"6.547542578s","version":"v0.0.10-15-g5089d5c","key_count":0,"backfill_progress":94},"error":null}

The same applies when there is an error, in that case, the response object should be omitted, instead of populating it with the nil value.

Copy link
Contributor

@rachit77 rachit77 left a comment

Choose a reason for hiding this comment

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

LGTM

@Stefan-Ethernal Stefan-Ethernal merged commit 10406a1 into main Dec 3, 2024
10 checks passed
@Stefan-Ethernal Stefan-Ethernal deleted the CDK-615-dac-rpc-omit-error-if-empty branch December 3, 2024 10:22
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.

5 participants