From d14c3fd4c257fd32141d446fac691e268f1e2603 Mon Sep 17 00:00:00 2001 From: Edwin Ang Date: Mon, 9 Apr 2012 15:04:56 +0700 Subject: [PATCH] exception handling processIt on CopyOrder.java --- .../src/org/compiere/process/CopyOrder.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java b/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java index aac140b7ab..e9f8bdf5b9 100644 --- a/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java +++ b/org.adempiere.base.process/src/org/compiere/process/CopyOrder.java @@ -94,10 +94,19 @@ public class CopyOrder extends SvrProcess { MOrder original = new MOrder (getCtx(), p_C_Order_ID, get_TrxName()); original.setDocAction(MOrder.DOCACTION_Complete); - original.processIt(MOrder.DOCACTION_Complete); + if (!original.processIt(MOrder.DOCACTION_Complete)) { + log.warning("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + throw new IllegalStateException("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + + } original.saveEx(); original.setDocAction(MOrder.DOCACTION_Close); - original.processIt(MOrder.DOCACTION_Close); + if (!original.processIt(MOrder.DOCACTION_Close)) { + log.warning("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + throw new IllegalStateException("Order Process Failed: " + original.getDocumentNo() + " " + original.getProcessMsg()); + + } + original.saveEx(); } //