Skip to content

Fix misleading response decoding error#102

Open
AndreMiras wants to merge 1 commit intoalthea-net:masterfrom
AndreMiras:feature/fix_misleading_error
Open

Fix misleading response decoding error#102
AndreMiras wants to merge 1 commit intoalthea-net:masterfrom
AndreMiras:feature/fix_misleading_error

Conversation

@AndreMiras
Copy link

For instance in v1.5 a eth_getBlockByNumber call that didn't contain the totalDifficulty field would fail with:

BadResponse("Size Limit 2961844000 Web3 Error Json deserialize error:
data did not match any variant of untagged enum ResponseData...")

While in fact it has nothing to do with the size limit. After this change the error would be:

BadResponse("Failed to process response: Json deserialize error:
data did not match any variant of untagged enum ResponseData...")

If the error ends up being buffer size limit related, the message is still explicit enough:

BadResponse("Failed to process response:
Error that occur during reading payload: payload reached size limit")

Also refs althea-net/web30#17

For instance in v1.5 a `eth_getBlockByNumber` call that didn't contain
the `totalDifficulty` field would fail with:
```
BadResponse("Size Limit 2961844000 Web3 Error Json deserialize error:
data did not match any variant of untagged enum ResponseData...")
```
While in fact it has nothing to do with the size limit.
After this change the error would be:
```
BadResponse("Failed to process response: Json deserialize error:
data did not match any variant of untagged enum ResponseData...")
```

If the error ends up being buffer size limit related, the message is
still explicit enough:
```
BadResponse("Failed to process response:
Error that occur during reading payload: payload reached size limit")
```

Also refs althea-net/web30#17
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