Update null block error message

This commit is contained in:
Nabarun 2025-03-19 19:55:50 +05:30
parent e0e2efd571
commit 951a970f3c
2 changed files with 2 additions and 2 deletions

View File

@ -376,7 +376,7 @@ export class EthClient implements EthClientInterface {
_handleGetBlockErrors (err: any): Array<null> {
if (err.code === errors.SERVER_ERROR && err.error) {
// Check null block error and return null array
if (err.error.message === NULL_BLOCK_ERROR) {
if (err.error.message.startsWith(NULL_BLOCK_ERROR)) {
return [null];
}

View File

@ -368,7 +368,7 @@ export class MonitoredStaticJsonRpcProvider extends providers.StaticJsonRpcProvi
} catch (err: any) {
// Ignore errors on fetching future blocks and if block is null (in case of filecoin)
if (err.code === ethersErrors.SERVER_ERROR && err.error) {
if (err.error.message === FUTURE_BLOCK_ERROR || err.error.message === NULL_BLOCK_ERROR) {
if (err.error.message === FUTURE_BLOCK_ERROR || err.error.message.startsWith(NULL_BLOCK_ERROR)) {
throw err;
}
}