From d5d48480ee6cf58c0992f4337e4f9005d94e0cd5 Mon Sep 17 00:00:00 2001 From: Muhammad Fadli Date: Thu, 31 Aug 2023 15:24:33 +0700 Subject: [PATCH] - fix response error elang --- src/helper/irs-api.ts | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index 6d13925..51ea15f 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -35,23 +35,15 @@ export const doTransaction = async ( }) .catch(e => { // Handle error - if (e.error.includes('saldo tidak cukup')) { - 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, - ); - } else { - throw new HttpException( - { - statusCode: HttpStatus.INTERNAL_SERVER_ERROR, - error: e.error, - }, - HttpStatus.INTERNAL_SERVER_ERROR, - ); - } + console.log('inierrorelang', e) + console.log('inierrorelang2', e.response.data) + throw new HttpException( + { + statusCode: HttpStatus.INTERNAL_SERVER_ERROR, + error: e.error, + }, + HttpStatus.INTERNAL_SERVER_ERROR, + ); }); } else if (supplier.code == 'NIRS') { const res = await axios.get(