MCPcopy
hub / github.com/subquery/subql / exitWithError

Function exitWithError

packages/node-core/src/process.ts:13–18  ·  view source on GitHub ↗
(error: Error | string, logger?: Pino.Logger, code = 1)

Source from the content-addressed store, hash-verified

11}
12
13export function exitWithError(error: Error | string, logger?: Pino.Logger, code = 1): never {
14 const errorMessage = typeof error === 'string' ? error : error.message;
15 logger?.error(error as any); /* Bad types */
16 monitorService?.write(`[EXIT ${code}]: ${errorMessage}`);
17 process.exit(code);
18}
19
20// Function argument is to allow for lazy evaluation only if monitor service is enabled
21export function monitorWrite(blockData: string | (() => string)): void {

Callers 15

getValidPortFunction · 0.90
getExistingProjectSchemaFunction · 0.90
reindexFunction · 0.90
initMethod · 0.90
assertDataSourcesFunction · 0.90
initUpgradeServiceMethod · 0.90
constructorMethod · 0.90
syncPoiMethod · 0.90
constructorMethod · 0.90

Calls 2

writeMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected