diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index 8d23673..1189aba 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -130,12 +130,24 @@ export const doTransaction = async ( console.log('restransini', res); console.log('restransini1', res.status); if (res.data.includes('Saldo anda tidak mencukupi')) { - throw '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, + ); } else { return res.data; } } catch (e) { - throw '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, + ); } } catch (err) {