From f6277bc88f9f6a78000bad60030b510ef4ae383e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 11 Feb 2026 15:34:21 +0100 Subject: [PATCH 1/3] add SubgraphRequestError and SubgraphBadIndexerError classes to SDK; update exception filters to handle subgraph errors --- .../src/common/filters/exception.filter.ts | 21 ++++++++- .../src/common/exceptions/exception.filter.ts | 20 ++++++++- .../src/common/exceptions/exception.filter.ts | 20 ++++++++- .../src/common/filter/exceptions.filter.ts | 21 ++++++++- .../src/common/exceptions/exception.filter.ts | 18 +++++++- .../src/common/filters/exception.filter.ts | 18 ++++++++ .../human-protocol-sdk/src/error.ts | 14 ++++++ .../human-protocol-sdk/src/index.ts | 2 + .../human-protocol-sdk/src/utils.ts | 45 +++++++++++++++++-- .../human-protocol-sdk/test/utils.test.ts | 20 +++++++-- 10 files changed, 188 insertions(+), 11 deletions(-) diff --git a/packages/apps/dashboard/server/src/common/filters/exception.filter.ts b/packages/apps/dashboard/server/src/common/filters/exception.filter.ts index fe958fdd00..5a5799e124 100644 --- a/packages/apps/dashboard/server/src/common/filters/exception.filter.ts +++ b/packages/apps/dashboard/server/src/common/filters/exception.filter.ts @@ -6,6 +6,10 @@ import { HttpException, } from '@nestjs/common'; import { Request, Response } from 'express'; +import { + SubgraphBadIndexerError, + SubgraphRequestError, +} from '@human-protocol/sdk'; import logger from '../../logger'; @@ -23,7 +27,22 @@ export class ExceptionFilter implements IExceptionFilter { message: 'Internal server error', }; - if (exception instanceof HttpException) { + if (exception instanceof SubgraphRequestError) { + status = HttpStatus.BAD_GATEWAY; + responseBody.message = exception.message; + + if (exception instanceof SubgraphBadIndexerError) { + this.logger.warn('Subgraph bad indexers', { + error: exception, + path: request.url, + }); + } else { + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); + } + } else if (exception instanceof HttpException) { status = exception.getStatus(); const exceptionResponse = exception.getResponse(); if (typeof exceptionResponse === 'string') { diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts index 96e7b88236..28d3a1bb0d 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts @@ -5,6 +5,10 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; +import { + SubgraphBadIndexerError, + SubgraphRequestError, +} from '@human-protocol/sdk'; import logger from '../../logger'; import { @@ -36,6 +40,8 @@ export class ExceptionFilter implements IExceptionFilter { return HttpStatus.UNPROCESSABLE_ENTITY; } else if (exception instanceof DatabaseError) { return HttpStatus.UNPROCESSABLE_ENTITY; + } else if (exception instanceof SubgraphRequestError) { + return HttpStatus.BAD_GATEWAY; } const exceptionStatusCode = exception.statusCode || exception.status; @@ -51,7 +57,19 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - if (status === HttpStatus.INTERNAL_SERVER_ERROR) { + if (exception instanceof SubgraphRequestError) { + if (exception instanceof SubgraphBadIndexerError) { + this.logger.warn('Subgraph bad indexers', { + error: exception, + path: request.url, + }); + } else { + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); + } + } else if (status === HttpStatus.INTERNAL_SERVER_ERROR) { this.logger.error('Unhandled exception', { error: exception, path: request.url, diff --git a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts index 558cff998a..478add2ec5 100644 --- a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts @@ -5,6 +5,10 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; +import { + SubgraphBadIndexerError, + SubgraphRequestError, +} from '@human-protocol/sdk'; import logger from '../../logger'; import { @@ -33,6 +37,8 @@ export class ExceptionFilter implements IExceptionFilter { return HttpStatus.CONFLICT; } else if (exception instanceof ServerError) { return HttpStatus.UNPROCESSABLE_ENTITY; + } else if (exception instanceof SubgraphRequestError) { + return HttpStatus.BAD_GATEWAY; } const exceptionStatusCode = exception.statusCode || exception.status; @@ -48,7 +54,19 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - if (status === HttpStatus.INTERNAL_SERVER_ERROR) { + if (exception instanceof SubgraphRequestError) { + if (exception instanceof SubgraphBadIndexerError) { + this.logger.warn('Subgraph bad indexers', { + error: exception, + path: request.url, + }); + } else { + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); + } + } else if (status === HttpStatus.INTERNAL_SERVER_ERROR) { this.logger.error('Unhandled exception', { error: exception, path: request.url, diff --git a/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts index 61eb3a6c4d..ad821471c5 100644 --- a/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts +++ b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts @@ -5,6 +5,10 @@ import { HttpException, HttpStatus, } from '@nestjs/common'; +import { + SubgraphBadIndexerError, + SubgraphRequestError, +} from '@human-protocol/sdk'; import logger from '../../logger'; import { AxiosError } from 'axios'; import * as errorUtils from '../utils/error'; @@ -21,7 +25,22 @@ export class ExceptionFilter implements IExceptionFilter { let status = HttpStatus.INTERNAL_SERVER_ERROR; let message: any = 'Internal Server Error'; - if (exception instanceof HttpException) { + if (exception instanceof SubgraphRequestError) { + status = HttpStatus.BAD_GATEWAY; + message = exception.message; + + if (exception instanceof SubgraphBadIndexerError) { + this.logger.warn('Subgraph bad indexers', { + error: errorUtils.formatError(exception), + path: request.url, + }); + } else { + this.logger.error('Subgraph request failed', { + error: errorUtils.formatError(exception), + path: request.url, + }); + } + } else if (exception instanceof HttpException) { status = exception.getStatus(); message = exception.getResponse(); } else if (exception instanceof AxiosError) { diff --git a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts index c1b6f3362a..0f2f818707 100644 --- a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts @@ -5,6 +5,10 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; +import { + SubgraphBadIndexerError, + SubgraphRequestError, +} from '@human-protocol/sdk'; import { ValidationError, @@ -36,6 +40,8 @@ export class ExceptionFilter implements IExceptionFilter { return HttpStatus.UNPROCESSABLE_ENTITY; } else if (exception instanceof DatabaseError) { return HttpStatus.UNPROCESSABLE_ENTITY; + } else if (exception instanceof SubgraphRequestError) { + return HttpStatus.BAD_GATEWAY; } const exceptionStatusCode = exception.statusCode || exception.status; @@ -51,7 +57,17 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - if (status === HttpStatus.INTERNAL_SERVER_ERROR) { + if (exception instanceof SubgraphBadIndexerError) { + this.logger.warn('Subgraph bad indexers', { + error: exception, + path: request.url, + }); + } else if (exception instanceof SubgraphRequestError) { + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); + } else if (status === HttpStatus.INTERNAL_SERVER_ERROR) { this.logger.error('Unhandled exception', { error: exception, path: request.url, diff --git a/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts b/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts index f15ee7315c..918a910277 100644 --- a/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts +++ b/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts @@ -1,3 +1,7 @@ +import { + SubgraphBadIndexerError, + SubgraphRequestError, +} from '@human-protocol/sdk'; import { ArgumentsHost, Catch, @@ -31,6 +35,20 @@ export class ExceptionFilter implements IExceptionFilter { responseBody.message = 'Unprocessable entity'; } this.logger.error('Database error', exception); + } else if (exception instanceof SubgraphRequestError) { + status = HttpStatus.BAD_GATEWAY; + responseBody.message = exception.message; + if (exception instanceof SubgraphBadIndexerError) { + this.logger.warn('Subgraph bad indexers', { + error: exception, + path: request.url, + }); + } else { + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); + } } else if (exception instanceof HttpException) { status = exception.getStatus(); const exceptionResponse = exception.getResponse(); diff --git a/packages/sdk/typescript/human-protocol-sdk/src/error.ts b/packages/sdk/typescript/human-protocol-sdk/src/error.ts index f5cbe8fd4c..7371a6baa3 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/error.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/error.ts @@ -349,3 +349,17 @@ export class InvalidKeyError extends Error { super(`Key "${key}" not found for address ${address}`); } } + +export class SubgraphRequestError extends Error { + public readonly statusCode?: number; + public readonly url: string; + + constructor(message: string, url: string, statusCode?: number) { + super(message); + this.name = this.constructor.name; + this.url = url; + this.statusCode = statusCode; + } +} + +export class SubgraphBadIndexerError extends SubgraphRequestError {} diff --git a/packages/sdk/typescript/human-protocol-sdk/src/index.ts b/packages/sdk/typescript/human-protocol-sdk/src/index.ts index 0e07f51949..e6a63ccefb 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/index.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/index.ts @@ -22,6 +22,8 @@ export { ContractExecutionError, InvalidEthereumAddressError, InvalidKeyError, + SubgraphBadIndexerError, + SubgraphRequestError, } from './error'; export { diff --git a/packages/sdk/typescript/human-protocol-sdk/src/utils.ts b/packages/sdk/typescript/human-protocol-sdk/src/utils.ts index 02ed1bd9aa..5d28485d4e 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/utils.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/utils.ts @@ -13,6 +13,8 @@ import { NonceExpired, NumericFault, ReplacementUnderpriced, + SubgraphBadIndexerError, + SubgraphRequestError, TransactionReplaced, WarnSubgraphApiKeyNotProvided, } from './error'; @@ -117,6 +119,38 @@ export const isIndexerError = (error: any): boolean => { return errorMessage.toLowerCase().includes('bad indexers'); }; +const getSubgraphErrorMessage = (error: any): string => { + return ( + error?.response?.errors?.[0]?.message || + error?.message || + error?.toString?.() || + 'Subgraph request failed' + ); +}; + +const getSubgraphStatusCode = (error: any): number | undefined => { + if (typeof error?.response?.status === 'number') { + return error.response.status; + } + + if (typeof error?.status === 'number') { + return error.status; + } + + return undefined; +}; + +const toSubgraphError = (error: any, url: string): Error => { + const message = getSubgraphErrorMessage(error); + const statusCode = getSubgraphStatusCode(error); + + if (isIndexerError(error)) { + return new SubgraphBadIndexerError(message, url, statusCode); + } + + return new SubgraphRequestError(message, url, statusCode); +}; + const sleep = (ms: number): Promise => { return new Promise((resolve) => setTimeout(resolve, ms)); }; @@ -154,7 +188,11 @@ export const customGqlFetch = async ( : undefined; if (!options) { - return await gqlFetch(url, query, variables, headers); + try { + return await gqlFetch(url, query, variables, headers); + } catch (error) { + throw toSubgraphError(error, url); + } } const hasMaxRetries = options.maxRetries !== undefined; @@ -177,10 +215,11 @@ export const customGqlFetch = async ( try { return await gqlFetch(targetUrl, query, variables, headers); } catch (error) { - lastError = error; + const wrappedError = toSubgraphError(error, targetUrl); + lastError = wrappedError; if (attempt === maxRetries || !isIndexerError(error)) { - throw error; + throw wrappedError; } const delay = baseDelay * attempt; diff --git a/packages/sdk/typescript/human-protocol-sdk/test/utils.test.ts b/packages/sdk/typescript/human-protocol-sdk/test/utils.test.ts index ac9d4cb0cf..d2f05e34c8 100644 --- a/packages/sdk/typescript/human-protocol-sdk/test/utils.test.ts +++ b/packages/sdk/typescript/human-protocol-sdk/test/utils.test.ts @@ -19,6 +19,8 @@ import { WarnSubgraphApiKeyNotProvided, ErrorRetryParametersMissing, ErrorRoutingRequestsToIndexerRequiresApiKey, + SubgraphBadIndexerError, + SubgraphRequestError, } from '../src/error'; import { getSubgraphUrl, @@ -340,7 +342,7 @@ describe('customGqlFetch', () => { maxRetries: 3, baseDelay: 10, }) - ).rejects.toThrow('Regular GraphQL error'); + ).rejects.toThrow(SubgraphRequestError); expect(gqlFetchSpy).toHaveBeenCalledTimes(1); }); @@ -360,7 +362,7 @@ describe('customGqlFetch', () => { maxRetries: 2, baseDelay: 10, }) - ).rejects.toEqual(badIndexerError); + ).rejects.toThrow(SubgraphBadIndexerError); expect(gqlFetchSpy).toHaveBeenCalledTimes(3); }); @@ -400,8 +402,20 @@ describe('customGqlFetch', () => { maxRetries: 1, baseDelay: 10, }) - ).rejects.toEqual(badIndexerError); + ).rejects.toThrow(SubgraphBadIndexerError); expect(gqlFetchSpy).toHaveBeenCalledTimes(2); }); + + test('wraps subgraph request errors even when no retry config is provided', async () => { + const gqlFetchSpy = vi + .spyOn(gqlFetch, 'default') + .mockRejectedValue(new Error('fetch failed')); + + await expect( + customGqlFetch(mockUrl, mockQuery, mockVariables) + ).rejects.toThrow(SubgraphRequestError); + + expect(gqlFetchSpy).toHaveBeenCalledTimes(1); + }); }); From 259549c1432ec218c2650cba9801c85b5a54a968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 11 Feb 2026 16:05:27 +0100 Subject: [PATCH 2/3] generated changeset --- .changeset/crisp-buckets-agree.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/crisp-buckets-agree.md diff --git a/.changeset/crisp-buckets-agree.md b/.changeset/crisp-buckets-agree.md new file mode 100644 index 0000000000..3915fea605 --- /dev/null +++ b/.changeset/crisp-buckets-agree.md @@ -0,0 +1,5 @@ +--- +"@human-protocol/sdk": minor +--- + +Added typed subgraph errors (SubgraphRequestError, SubgraphBadIndexerError) and wrapped subgraph request failures with these classes From ddf360dcf3b3a15025dce21a9cadc2b6dc8e76e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 16 Feb 2026 16:20:02 +0100 Subject: [PATCH 3/3] streamline subgraph error logging in exception filters --- .../src/common/filters/exception.filter.ts | 20 +++++-------------- .../src/common/exceptions/exception.filter.ts | 20 +++++-------------- .../src/common/exceptions/exception.filter.ts | 20 +++++-------------- .../src/common/filter/exceptions.filter.ts | 20 +++++-------------- .../src/common/exceptions/exception.filter.ts | 12 ++--------- .../src/common/filters/exception.filter.ts | 20 +++++-------------- 6 files changed, 27 insertions(+), 85 deletions(-) diff --git a/packages/apps/dashboard/server/src/common/filters/exception.filter.ts b/packages/apps/dashboard/server/src/common/filters/exception.filter.ts index 5a5799e124..d65c27ce19 100644 --- a/packages/apps/dashboard/server/src/common/filters/exception.filter.ts +++ b/packages/apps/dashboard/server/src/common/filters/exception.filter.ts @@ -6,10 +6,7 @@ import { HttpException, } from '@nestjs/common'; import { Request, Response } from 'express'; -import { - SubgraphBadIndexerError, - SubgraphRequestError, -} from '@human-protocol/sdk'; +import { SubgraphRequestError } from '@human-protocol/sdk'; import logger from '../../logger'; @@ -31,17 +28,10 @@ export class ExceptionFilter implements IExceptionFilter { status = HttpStatus.BAD_GATEWAY; responseBody.message = exception.message; - if (exception instanceof SubgraphBadIndexerError) { - this.logger.warn('Subgraph bad indexers', { - error: exception, - path: request.url, - }); - } else { - this.logger.error('Subgraph request failed', { - error: exception, - path: request.url, - }); - } + this.logger.error('Unhandled subgraph error', { + error: exception, + path: request.url, + }); } else if (exception instanceof HttpException) { status = exception.getStatus(); const exceptionResponse = exception.getResponse(); diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts index 28d3a1bb0d..5bfc921d06 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/exceptions/exception.filter.ts @@ -5,10 +5,7 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; -import { - SubgraphBadIndexerError, - SubgraphRequestError, -} from '@human-protocol/sdk'; +import { SubgraphRequestError } from '@human-protocol/sdk'; import logger from '../../logger'; import { @@ -58,17 +55,10 @@ export class ExceptionFilter implements IExceptionFilter { const message = exception.message || 'Internal server error'; if (exception instanceof SubgraphRequestError) { - if (exception instanceof SubgraphBadIndexerError) { - this.logger.warn('Subgraph bad indexers', { - error: exception, - path: request.url, - }); - } else { - this.logger.error('Subgraph request failed', { - error: exception, - path: request.url, - }); - } + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); } else if (status === HttpStatus.INTERNAL_SERVER_ERROR) { this.logger.error('Unhandled exception', { error: exception, diff --git a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts index 478add2ec5..d9d7940c69 100644 --- a/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts +++ b/packages/apps/fortune/recording-oracle/src/common/exceptions/exception.filter.ts @@ -5,10 +5,7 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; -import { - SubgraphBadIndexerError, - SubgraphRequestError, -} from '@human-protocol/sdk'; +import { SubgraphRequestError } from '@human-protocol/sdk'; import logger from '../../logger'; import { @@ -55,17 +52,10 @@ export class ExceptionFilter implements IExceptionFilter { const message = exception.message || 'Internal server error'; if (exception instanceof SubgraphRequestError) { - if (exception instanceof SubgraphBadIndexerError) { - this.logger.warn('Subgraph bad indexers', { - error: exception, - path: request.url, - }); - } else { - this.logger.error('Subgraph request failed', { - error: exception, - path: request.url, - }); - } + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); } else if (status === HttpStatus.INTERNAL_SERVER_ERROR) { this.logger.error('Unhandled exception', { error: exception, diff --git a/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts index ad821471c5..cf8bea9b16 100644 --- a/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts +++ b/packages/apps/human-app/server/src/common/filter/exceptions.filter.ts @@ -5,10 +5,7 @@ import { HttpException, HttpStatus, } from '@nestjs/common'; -import { - SubgraphBadIndexerError, - SubgraphRequestError, -} from '@human-protocol/sdk'; +import { SubgraphRequestError } from '@human-protocol/sdk'; import logger from '../../logger'; import { AxiosError } from 'axios'; import * as errorUtils from '../utils/error'; @@ -29,17 +26,10 @@ export class ExceptionFilter implements IExceptionFilter { status = HttpStatus.BAD_GATEWAY; message = exception.message; - if (exception instanceof SubgraphBadIndexerError) { - this.logger.warn('Subgraph bad indexers', { - error: errorUtils.formatError(exception), - path: request.url, - }); - } else { - this.logger.error('Subgraph request failed', { - error: errorUtils.formatError(exception), - path: request.url, - }); - } + this.logger.error('Subgraph request failed', { + error: errorUtils.formatError(exception), + path: request.url, + }); } else if (exception instanceof HttpException) { status = exception.getStatus(); message = exception.getResponse(); diff --git a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts index 0f2f818707..de67ef3283 100644 --- a/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts +++ b/packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts @@ -5,10 +5,7 @@ import { HttpStatus, } from '@nestjs/common'; import { Request, Response } from 'express'; -import { - SubgraphBadIndexerError, - SubgraphRequestError, -} from '@human-protocol/sdk'; +import { SubgraphRequestError } from '@human-protocol/sdk'; import { ValidationError, @@ -57,12 +54,7 @@ export class ExceptionFilter implements IExceptionFilter { const status = this.getStatus(exception); const message = exception.message || 'Internal server error'; - if (exception instanceof SubgraphBadIndexerError) { - this.logger.warn('Subgraph bad indexers', { - error: exception, - path: request.url, - }); - } else if (exception instanceof SubgraphRequestError) { + if (exception instanceof SubgraphRequestError) { this.logger.error('Subgraph request failed', { error: exception, path: request.url, diff --git a/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts b/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts index 918a910277..eac86fcbea 100644 --- a/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts +++ b/packages/apps/reputation-oracle/server/src/common/filters/exception.filter.ts @@ -1,7 +1,4 @@ -import { - SubgraphBadIndexerError, - SubgraphRequestError, -} from '@human-protocol/sdk'; +import { SubgraphRequestError } from '@human-protocol/sdk'; import { ArgumentsHost, Catch, @@ -38,17 +35,10 @@ export class ExceptionFilter implements IExceptionFilter { } else if (exception instanceof SubgraphRequestError) { status = HttpStatus.BAD_GATEWAY; responseBody.message = exception.message; - if (exception instanceof SubgraphBadIndexerError) { - this.logger.warn('Subgraph bad indexers', { - error: exception, - path: request.url, - }); - } else { - this.logger.error('Subgraph request failed', { - error: exception, - path: request.url, - }); - } + this.logger.error('Subgraph request failed', { + error: exception, + path: request.url, + }); } else if (exception instanceof HttpException) { status = exception.getStatus(); const exceptionResponse = exception.getResponse();