Skip to content

Re-think Revert Reason Parsing  #3053

@kclowes

Description

@kclowes

What was wrong?

Many nodes/networks return error data in different formats that doesn't comply with the JSON-RPC error spec. raise_contract_logic_error_on_revert attempts to parse the errors, and is getting unwieldy. It returns unexpected errors when parsing fails.

How can it be fixed?

One option is to check if the error returned matches the JSON-RPC error spec. If it does, parse the error and return the parsed message. If we go this route, I think we should still keep the data attribute on ContractLogicError so that users can pass along the raw data to other contracts if they'd like. If the response doesn't match the spec, we'd return some message that indicates that we can't parse it, along with the raw error data. I'm also open to other ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions