- fix error metro

This commit is contained in:
Muhammad Fadli 2023-04-21 12:12:10 +07:00
parent 5cf8c7661c
commit 8943d8b8ac

View File

@ -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) {