From 78c3175f317019f67a081f867c622527f4ddcd29 Mon Sep 17 00:00:00 2001 From: Edwin Ang Date: Mon, 9 Apr 2012 15:01:30 +0700 Subject: [PATCH] exception handling processIt on BankTransfer.java --- .../src/org/eevolution/process/BankTransfer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/eevolution/process/BankTransfer.java b/org.adempiere.base/src/org/eevolution/process/BankTransfer.java index a5e30b02fa..cec01302b0 100644 --- a/org.adempiere.base/src/org/eevolution/process/BankTransfer.java +++ b/org.adempiere.base/src/org/eevolution/process/BankTransfer.java @@ -159,7 +159,10 @@ public class BankTransfer extends SvrProcess paymentBankFrom.setC_DocType_ID(false); paymentBankFrom.setC_Charge_ID(p_C_Charge_ID); paymentBankFrom.saveEx(); - paymentBankFrom.processIt(MPayment.DOCACTION_Complete); + if(!paymentBankFrom.processIt(MPayment.DOCACTION_Complete)) { + log.warning("Payment Process Failed: " + paymentBankFrom + " - " + paymentBankFrom.getProcessMsg()); + throw new IllegalStateException("Payment Process Failed: " + paymentBankFrom + " - " + paymentBankFrom.getProcessMsg()); + } paymentBankFrom.saveEx(); MPayment paymentBankTo = new MPayment(getCtx(), 0 , get_TrxName()); @@ -178,7 +181,10 @@ public class BankTransfer extends SvrProcess paymentBankTo.setC_DocType_ID(true); paymentBankTo.setC_Charge_ID(p_C_Charge_ID); paymentBankTo.saveEx(); - paymentBankTo.processIt(MPayment.DOCACTION_Complete); + if (!paymentBankTo.processIt(MPayment.DOCACTION_Complete)) { + log.warning("Payment Process Failed: " + paymentBankTo + " - " + paymentBankTo.getProcessMsg()); + throw new IllegalStateException("Payment Process Failed: " + paymentBankTo + " - " + paymentBankTo.getProcessMsg()); + } paymentBankTo.saveEx(); m_created++; return;