multicall error response data is empty, useCall error is undefined
See original GitHub issueI am calling useCall
on moonbaseAlpha chain, it is using their multicall contract defined in useDapp
code. When the function returns error, I get error thrown in browser console from rpc, I also get error code in rpc response payload, but useCall doesn’t return any error
rpc response:
{"jsonrpc":"2.0","error":{"code":-32603,"message":"VM Exception while processing transaction: revert","data":""},"id":100}
Browser error:
Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32603,\"message\":\"VM Exception while processing transaction: revert\",\"data\":\"\"},\"id\":85}\n","error":{"code":-32603,"data":""},"requestBody":"{\"method\":\"eth_call\",\"params\":[{\"to\":\"0x4e2cfca20580747adba58cd677a998f8b261fc21\",\"data\":\"0x252dba42000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000093dceea2e035090f4b18b0723cfa456423814bfb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024ffc9896b000000000000000000000000fbea1b97406c6945d07f50f588e54144ea8b684f0000000000000000000000000000000000000000000000000000000000000000000000000000000093dceea2e035090f4b18b0723cfa456423814bfb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024f2b0a55d000000000000000000000000000000000000000000000000000000000000592900000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffd2aad7f60626608fa4a5d34768f7892d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002470a08231000000000000000000000000fbea1b97406c6945d07f50f588e54144ea8b684f0000000000000000000000000000000000000000000000000000000000000000000000000000000093dceea2e035090f4b18b0723cfa456423814bfb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c0ea1f11000000000000000000000000000000000000000000000000000000000000592900000000000000000000000000000000000000000000000000000000\"},\"0x202577\"],\"id\":85,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://rpc.api.moonbase.moonbeam.network/"}, data="0x", code=CALL_EXCEPTION, version=providers/5.6.4)
at Logger.makeError (index.js?dd68:219:1)
at Logger.throwError (index.js?dd68:228:1)
at checkError (json-rpc-provider.js?8679:59:1)
at JsonRpcProvider.eval (json-rpc-provider.js?8679:518:1)
at Generator.throw (<anonymous>)
at rejected (json-rpc-provider.js?8679:6:42)
and yet error is undefined returned from useCall
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Why is data in response.data.error undefined? - Stack Overflow
I'm trying to update a react redux node with jwt auth setup and trying to figure out why this code for password reset...
Read more >Hooks - useDApp
A low-level function that makes a call to a specific method of a specific contract and returns the value or error if present....
Read more >How to get reason revert using web3.eth.call
call(…) you will see a new message like. Error: Your request got reverted with the following reason string: This is the revert reason!...
Read more >Optional chaining '?.' - The Modern JavaScript Tutorial
Once again, if the element doesn't exist, we'll get an error accessing . ... let user = null; alert( user?.address ); // undefined...
Read more >Type error: n is undefined (Example) | Treehouse Community
In the very first response you had to Steven Parker , you showed this line: import PropTypes from 'prop-types';. This is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mj426382 Seeing the same behavior, the real problem is not why the call failed, it’s that
useCall
does not report the error properly and as such, there is no way to inform the user that something went wrong.We’re working on detecting the actual error better. (Note that it will properly work only with Multicall v2).
cc @jakvbs
This makes the problem difficult, so as much info as possible is appreciated.
@heycryptobob Is the problem also happening periodically and not consistently? Do you see any pattern?