Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5CA51200D4B for ; Mon, 27 Nov 2017 11:15:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5B203160C13; Mon, 27 Nov 2017 10:15:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7AB52160C02 for ; Mon, 27 Nov 2017 11:15:09 +0100 (CET) Received: (qmail 18076 invoked by uid 500); 27 Nov 2017 10:15:08 -0000 Mailing-List: contact notifications-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list notifications@ofbiz.apache.org Received: (qmail 18067 invoked by uid 99); 27 Nov 2017 10:15:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2017 10:15:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D366EC123D for ; Mon, 27 Nov 2017 10:15:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.011 X-Spam-Level: X-Spam-Status: No, score=-99.011 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KB_WAM_FROM_NAME_SINGLEWORD=0.2, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id MhanvEv034Vv for ; Mon, 27 Nov 2017 10:15:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 693405F1D5 for ; Mon, 27 Nov 2017 10:15:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id AA054E00CD for ; Mon, 27 Nov 2017 10:15:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 689CD2419F for ; Mon, 27 Nov 2017 10:15:00 +0000 (UTC) Date: Mon, 27 Nov 2017 10:15:00 +0000 (UTC) From: "Jacques Le Roux (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OFBIZ-10021) Accounting: Handle service response effectively MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Nov 2017 10:15:10 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-10021?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D162= 66617#comment-16266617 ]=20 Jacques Le Roux commented on OFBIZ-10021: ----------------------------------------- Hi Suraj, Your patch looks good to me but there is a small issue. You use {code} payResult =3D dispatcher.runSync("createPayment", paymentCtx); + if (ServiceUtil.isError(payResult)) { + throw new GeneralException(payResult); + } } catch (GenericServiceException e) { throw new GeneralException(e); } @@ -1015,6 +1020,9 @@ Map transResult; try { transResult =3D dispatcher.runSync("createFinAccountTrans", tr= ansCtx); + if (ServiceUtil.isError(transResult)) { + throw new GeneralException(transResult); + } {code} But there is no GeneralException method to handle map. So I fixed it using {code} Index: applications/accounting/src/main/java/org/apache/ofbiz/accounting/fi= naccount/FinAccountPaymentServices.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- applications/accounting/src/main/java/org/apache/ofbiz/accounting/finac= count/FinAccountPaymentServices.java=09(r=EF=BF=BDvision 1816414) +++ applications/accounting/src/main/java/org/apache/ofbiz/accounting/finac= count/FinAccountPaymentServices.java=09(copie de travail) @@ -990,6 +992,9 @@ Map payResult; try { payResult =3D dispatcher.runSync("createPayment", paymentCtx); + if (ServiceUtil.isError(payResult)) { + throw new GeneralException(ServiceUtil.getErrorMessage(pay= Result)); + } } catch (GenericServiceException e) { throw new GeneralException(e); } @@ -1015,6 +1020,9 @@ Map transResult; try { transResult =3D dispatcher.runSync("createFinAccountTrans", tr= ansCtx); + if (ServiceUtil.isError(transResult)) { + throw new GeneralException(ServiceUtil.getErrorMessage(tra= nsResult)); + } } catch (GenericServiceException e) { throw new GeneralException(e); } {code} But I have still 2 failures locally in auto-accounting-budget-tests.testCre= ateBudget and auto-accounting-budget-tests.testUpdateBudgetStatus. Since sometimes testIntegration gives false negative reports in Windows (I = use Windows), please check on your side. Also check that you have not unrelated fixes in like {code} Index: accounting/src/main/java/org/apache/ofbiz/accounting/invoice/Invoice= Worker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWor= ker.java=09(revision 1816414) +++ accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWor= ker.java=09(working copy) @@ -510,11 +510,8 @@ if (UtilValidate.isNotEmpty(party) && party.getString("baseCur= rencyUomId") !=3D null) { otherCurrencyUomId =3D party.getString("baseCurrencyUomId"= ); } else { - otherCurrencyUomId =3D EntityUtilProperties.getPropertyVal= ue("general", "currency.uom.id.default", delegator); + otherCurrencyUomId =3D EntityUtilProperties.getPropertyVal= ue("general", "currency.uom.id.default", "USD", delegator); } - if (otherCurrencyUomId =3D=3D null) { - otherCurrencyUomId =3D "USD"; // final default - } } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting database records....", modu= le); } {code} Thanks! > Accounting: Handle service response effectively > ----------------------------------------------- > > Key: OFBIZ-10021 > URL: https://issues.apache.org/jira/browse/OFBIZ-10021 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Reporter: Suraj Khurana > Assignee: Jacques Le Roux > Attachments: OFBIZ-10021.patch > > -- This message was sent by Atlassian JIRA (v6.4.14#64029)