ResponseEntity performTxn()

in service/src/main/java/org/apache/fineract/cn/deposit/service/rest/TransactionRestController.java [76:101]


    ResponseEntity<TransactionResponseData> performTxn(@RequestParam("action") String action, @RequestBody TransactionRequestData requestData)
            throws Throwable {
        int retryCount = 0;
        Exception e = null;
        do {
            retryCount++;
            logger.info("Try transaction :  " + retryCount + " of " + txnMaxRetry);
            System.out.println("*******Try transaction :  " + retryCount + " of " + txnMaxRetry);
            try {
                CommandCallback<TransactionResponseData> result = commandGateway.process(new TransactionCommand(requestData, TransactionActionType.valueOf(action)),
                        TransactionResponseData.class);

                return ResponseEntity.ok(result.get());
            } catch (Exception ex) {
                logger.info(ex.getClass().getCanonicalName());
                System.out.println(ex.getClass().getCanonicalName());
                logger.info(ex.getClass().getName());
                System.out.println(ex.getClass().getName());
                logger.info(ex.getMessage());
                System.out.println(ex.getMessage());
                e=ex;
            }
        } while (retryCount < txnMaxRetry);
        //throw the last exception
        throw e;
    }