From cb18c6bbca87e128038a37e294de87ccd06ca40b Mon Sep 17 00:00:00 2001 From: Mantas S Date: Fri, 21 Jul 2023 14:44:04 +0300 Subject: [PATCH] fix --- src/app.controller.ts | 16 ++-------------- src/generic.interceptor.ts | 2 ++ 2 files changed, 4 insertions(+), 14 deletions(-) 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); }, }), );