From 5cf8c7661cc027971b69df0711bff3c115fce5f8 Mon Sep 17 00:00:00 2001 From: Muhammad Fadli Date: Fri, 21 Apr 2023 12:07:57 +0700 Subject: [PATCH] - fix error metro --- src/helper/irs-api.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index b4e07a1..8d23673 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import {NotFoundException} from "@nestjs/common"; +import {HttpException, HttpStatus, NotFoundException} from "@nestjs/common"; const irs_url = 'http://h2h.elangpixiu.com/api/h2h'; const irs_id = 'PT0005'; @@ -141,8 +141,13 @@ export const doTransaction = async ( } catch (err) { console.log('errtransaction', err); console.log('errtransaction2', err.response.data); - throw new NotFoundException( - 'maaf saat ini transaksi sedang tidak bisa diproses, silahkan hubungi WND Solutions untuk bisa di proses kembali', + + throw new HttpException( + { + statusCode: HttpStatus.INTERNAL_SERVER_ERROR, + error: 'maaf saat ini transaksi sedang tidak bisa diproses, silahkan hubungi WND Solutions untuk bisa di proses kembali', + }, + HttpStatus.INTERNAL_SERVER_ERROR, ); } };