You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I'm considering working on this and using jsonschema to validate the error response. If the error does not follow convention, an exception will be raised with the original error data.
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 onContractLogicError
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.The text was updated successfully, but these errors were encountered: