diff --git a/src/app.controller.ts b/src/app.controller.ts index bbcf23b3..b6bf5d12 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,12 +1,4 @@ -import { - Body, - Controller, - Get, - Post, - Query, - UseFilters, - HttpException, -} from '@nestjs/common'; +import { Body, Controller, Get, Post, Query, UseFilters } from '@nestjs/common'; import { AppService } from './app.service'; import { GetPoolAndTokenVolumesReply, @@ -22,11 +14,7 @@ export class AppController { @Get('tvl') async getTvl(@Query() req: GetTvlRequest): Promise { - try { - return await this.appService.getTvl(req); - } catch (e) { - throw new HttpException(e.message, 500); - } + return await this.appService.getTvl(req); } @Post('pool-token-volumes') diff --git a/src/generic.interceptor.ts b/src/generic.interceptor.ts index 42712c98..2f403990 100644 --- a/src/generic.interceptor.ts +++ b/src/generic.interceptor.ts @@ -3,6 +3,7 @@ import { ExecutionContext, Injectable, NestInterceptor, + HttpException, } from '@nestjs/common'; import { Observable, tap } from 'rxjs'; import { log } from './util/logger/logger'; @@ -34,6 +35,7 @@ export class GenericInterceptor implements NestInterceptor { detail: err?.name, endpoint: endpoint.name, }); + throw new HttpException(err.message, 500); }, }), );