Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not catch some Exception. #4704

Open
tmingyuan opened this issue Apr 21, 2024 · 0 comments
Open

Can not catch some Exception. #4704

tmingyuan opened this issue Apr 21, 2024 · 0 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@tmingyuan
Copy link

Ethers Version

6.12.0

Search Terms

No response

Describe the Problem

I will initiate a lot of transactions at the same time. Due to the instability of testnet RPC, failures often occur. I have written a lot of catch codes, but not all exceptions can be caught.

Exception Info:

/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/errors.js:129
            error = new Error(message);
                    ^

Error: response body is not valid JSON (operation="bodyJson", info={ "response": {  } }, code=UNSUPPORTED_OPERATION, version=6.12.0)
    at makeError (/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/errors.js:129:21)
    at assert (/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/errors.js:149:15)
    at get bodyJson [as bodyJson] (/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/fetch.js:729:36)
    at JsonRpcProvider._send (/root/berachain-tools/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:887:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /root/berachain-tools/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:281:40 {
  code: 'UNSUPPORTED_OPERATION',
  operation: 'bodyJson',
  info: { response: FetchResponse {} },
  shortMessage: 'response body is not valid JSON'
}

Code Snippet

No response

Contract ABI

No response

Errors

/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/errors.js:129
            error = new Error(message);
                    ^

Error: response body is not valid JSON (operation="bodyJson", info={ "response": {  } }, code=UNSUPPORTED_OPERATION, version=6.12.0)
    at makeError (/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/errors.js:129:21)
    at assert (/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/errors.js:149:15)
    at get bodyJson [as bodyJson] (/root/berachain-tools/node_modules/ethers/lib.commonjs/utils/fetch.js:729:36)
    at JsonRpcProvider._send (/root/berachain-tools/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:887:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /root/berachain-tools/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:281:40 {
  code: 'UNSUPPORTED_OPERATION',
  operation: 'bodyJson',
  info: { response: FetchResponse {} },
  shortMessage: 'response body is not valid JSON'
}

Environment

No response

Environment (Other)

No response

@tmingyuan tmingyuan added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants