From f11122798fe1a8ee575de1c4a8161386270489f6 Mon Sep 17 00:00:00 2001 From: sahalali Date: Fri, 25 Oct 2024 17:59:26 +0530 Subject: [PATCH] Handled API failure cases --- src/service/http/http.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/service/http/http.service.ts b/src/service/http/http.service.ts index eb73268..44b54fa 100644 --- a/src/service/http/http.service.ts +++ b/src/service/http/http.service.ts @@ -1,5 +1,6 @@ import { Injectable } from "@nestjs/common"; import axios from "axios"; +import { Exception } from "../../helper"; @Injectable() export class HttpService { @@ -19,6 +20,7 @@ export class HttpService { return response?.data; } catch (e) { console.log(e); + return Exception.internalServerError(e.message); } }