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
{{ message }}
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
Getting this error message using the public endpoint
Error: failed to get recent blockhash: TypeError: fetch failed
at Connection.getLatestBlockhash (/home/jimii/Documents/crew/test-web/node_modules/@solana/web3.js/src/connection.ts:4593:13)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async testConnection (/home/jimii/Documents/crew/test-web/src/main.ts:10:13)
Example use case
When using RPC methods like getLatestBlockhash that might fail if a user is rate limited, it'll be useful to alert the user about that failure being because or a rate-limit
Details
Having HTTP status codes in the error response/why the getLatestBlockhash method failed will be helpful in alerting the developer when an error arises from the RPC and not the code
The text was updated successfully, but these errors were encountered:
We have this in the forthcoming version of web3.js. Take a look!
try{constlatestBlockhash=awaitrpc.getLatestBlockhash().send();}catch(e){if(isSolanaError(e,SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR)){if(e.context.code===429){// We got rate limited!}}}
I would love for you to build / rebuild whatever you're making using the new web3.js, and give us feedback!
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.
Motivation
Getting this error message using the public endpoint
Example use case
When using RPC methods like
getLatestBlockhash
that might fail if a user is rate limited, it'll be useful to alert the user about that failure being because or a rate-limitDetails
Having HTTP status codes in the error response/why the
getLatestBlockhash
method failed will be helpful in alerting the developer when an error arises from the RPC and not the codeThe text was updated successfully, but these errors were encountered: