How do I use the processFunc on FetchRequests? #4049
Unanswered
fahimuddin-brillmark
asked this question in
Q&A
Replies: 1 comment
-
The processFunc must return a FetchResponse. Right now you are retuning undefined. Try adding |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Ethers Version
6.3.0
Search Terms
assertOk, typeError, fetchRequest, processFunc
Describe the Problem
Hello team,
I am having an issue while using
JsonRpcProvider
api to get the chain id from an endpoint usingeth_chainId
method. So, I am using.send()
method which is triggeringprocessFunc
callback fromFetchRequest
class. In theprocessFunc
I am getting this error.Looks like the error is happening in here : https://github.com/ethers-io/ethers.js/blob/main/src.ts/providers/provider-jsonrpc.ts
At
Line 24 - response.assertOk();
Why I am getting that error while doing simple call using
.send()
method.The Reason I am doing this :
I want to catch numeric error codes from
FetchResponse
class instead of getting string error codes from.send()
method fromErrorCode
: https://docs.ethers.org/v6/api/utils/errors/#ErrorCodeCode Snippet
Contract ABI
No response
Errors
Environment
node.js (v12 or newer)
Environment (Other)
No response
Beta Was this translation helpful? Give feedback.
All reactions