From 8e6fe1b1641953700667b36a735b8393ae5d412f Mon Sep 17 00:00:00 2001 From: Fadli Date: Tue, 29 Nov 2022 00:01:54 +0700 Subject: [PATCH] - fix error message when balance supplier is not enough --- src/helper/irs-api.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index cf51467..4d7cbf0 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -55,6 +55,10 @@ export const doTransaction = async ( console.log('restranshemat', res) } catch (err) { console.log('errtranshemat', err); - throw err; - } + if (err.includes('Maaf Saldo anda tidak mencukupi')) { + throw 'maaf saat ini transaksi sedang tidak bisa diproses, silahkan hubungi WND Solutions untuk bisa di proses kembali'; + } else { + throw err; + } + } };