MCPcopy Create free account
hub / github.com/subquery/subql / getApiDecodeErrMsg

Function getApiDecodeErrMsg

packages/node/src/utils/substrate.ts:500–517  ·  view source on GitHub ↗
(errMsg: string)

Source from the content-addressed store, hash-verified

498}
499
500function getApiDecodeErrMsg(errMsg: string): string {
501 const decodedErrMsgs = [
502 'Unable to decode',
503 'failed decoding',
504 'unknown type',
505 ];
506
507 if (!decodedErrMsgs.find((decodedErrMsg) => errMsg.includes(decodedErrMsg))) {
508 return '';
509 }
510
511 return (
512 `\nThis is because the block cannot be decoded. To solve this you can either:` +
513 '\n* Skip the block' +
514 '\n* Update the chain types. You can test this by viewing the block with https://polkadot.js.org/apps/' +
515 '\nFor further information please read the docs: https://academy.subquery.network/'
516 );
517}

Callers 3

getHeaderForHashFunction · 0.85
getBlockByHeightFunction · 0.85
fetchEventsRangeFunction · 0.85

Calls 1

findMethod · 0.65

Tested by

no test coverage detected