You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2021/01/17 21:42:25 UTC

[fineract] 02/02: FINERACT-1157:UnsupportedOperationException at InteropServiceImpl

This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit ce825c912d6ba760f36a8c393623c284579674d0
Author: Wandji Collins <co...@gmail.com>
AuthorDate: Sun Jan 17 17:04:06 2021 +0100

    FINERACT-1157:UnsupportedOperationException at InteropServiceImpl
---
 .../apache/fineract/interoperation/service/InteropServiceImpl.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java
index 78351a6..89eccab 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/interoperation/service/InteropServiceImpl.java
@@ -558,7 +558,7 @@ public class InteropServiceImpl implements InteropService {
         MoneyData requestFee = request.getFspFee();
         if (requestFee != null) {
             if (!savingsAccount.getCurrency().getCode().equals(requestFee.getCurrency())) {
-                throw new UnsupportedOperationException();
+                throw new HttpClientErrorException(HttpStatus.resolve(400));
             }
             // TODO: compare with calculated quote fee
             total = MathUtil.add(total, requestFee.getAmount());
@@ -566,7 +566,7 @@ public class InteropServiceImpl implements InteropService {
         MoneyData requestCommission = request.getFspCommission();
         if (requestCommission != null) {
             if (!savingsAccount.getCurrency().getCode().equals(requestCommission.getCurrency())) {
-                throw new UnsupportedOperationException();
+                throw new HttpClientErrorException(HttpStatus.resolve(400));
             }
             // TODO: compare with calculated quote commission
             total = MathUtil.subtractToZero(total, requestCommission.getAmount());