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

Function handleServiceCall

packages/node-core/src/admin/admin.controller.ts:26–39  ·  view source on GitHub ↗
(serviceCall: () => Promise<T> | T)

Source from the content-addressed store, hash-verified

24const REWIND_RESPONSE_TIMEOUT = 120; //seconds
25
26async function handleServiceCall<T>(serviceCall: () => Promise<T> | T): Promise<T> {
27 try {
28 return await serviceCall();
29 } catch (e: any) {
30 logger.error(e);
31 throw new HttpException(
32 {
33 status: HttpStatus.INTERNAL_SERVER_ERROR,
34 error: e.message,
35 },
36 HttpStatus.INTERNAL_SERVER_ERROR
37 );
38 }
39}
40
41@Controller('admin')
42export class AdminController {

Callers 6

getIndexBlocksMethod · 0.85
getIndexForksMethod · 0.85
getIndexBlockRecordMethod · 0.85
getPoiRangeMethod · 0.85
getPoisByRangeMethod · 0.85
getDbSizeMethod · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected