mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-07-31 04:02:06 +00:00
Update null block error message
This commit is contained in:
parent
e0e2efd571
commit
951a970f3c
@ -376,7 +376,7 @@ export class EthClient implements EthClientInterface {
|
|||||||
_handleGetBlockErrors (err: any): Array<null> {
|
_handleGetBlockErrors (err: any): Array<null> {
|
||||||
if (err.code === errors.SERVER_ERROR && err.error) {
|
if (err.code === errors.SERVER_ERROR && err.error) {
|
||||||
// Check null block error and return null array
|
// 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];
|
return [null];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ export class MonitoredStaticJsonRpcProvider extends providers.StaticJsonRpcProvi
|
|||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
// Ignore errors on fetching future blocks and if block is null (in case of filecoin)
|
// 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.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;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user