Skip to content

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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2024

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.

6 participants