Skip to content

include more context with exceptions #3094

@reedsa

Description

@reedsa

RPC errors are handled in various ways depending on the format of the response. When a response is malformed in a way that raises a BadResponseFormat, the raw response is appended to the error message, making it difficult for humans to parse.

Other exceptions like ValueError could also provide better messages and information.

For this effort, consider splitting up the message from the response as separate arguments to the excpetions. Also provide more context about the errors if possible.

It may be useful to audit other exceptions in web3.py to see if they can be improved as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v7breaking changes considered for v7

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions