fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] vorburger commented on a change in pull request #1218: FINERACT-1098 - Catch JpaSystemException in jpa transactions
Date Sat, 01 Aug 2020 11:29:15 GMT

vorburger commented on a change in pull request #1218:
URL: https://github.com/apache/fineract/pull/1218#discussion_r463953157



##########
File path: fineract-provider/src/main/java/org/apache/fineract/accounting/closure/service/GLClosureWritePlatformServiceJpaRepositoryImpl.java
##########
@@ -142,8 +144,7 @@ public CommandProcessingResult deleteGLClosure(final Long glClosureId)
{
      * @param command
      * @param dve
      */
-    private void handleGLClosureIntegrityIssues(final JsonCommand command, final DataIntegrityViolationException
dve) {
-        final Throwable realCause = dve.getMostSpecificCause();
+    private void handleGLClosureIntegrityIssues(final JsonCommand command, final Throwable
realCause, final Exception dve) {

Review comment:
       @xurror it's not super important, but I thought perhaps this code review feedback could
interest you: Instead of changing this like you have, what you really want to do in a case
like this is just use the common super class of `JpaSystemException` and `DataIntegrityViolationException`
like suggested below, does this make sense? Do you want to change this like that? It makes
the code easier to read.
   
   ```suggestion
       private void handleGLClosureIntegrityIssues(final JsonCommand command, final NestedRuntimeException
dve) {
           final Throwable realCause = dve.getMostSpecificCause();
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message