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



##########
File path: 
fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDropdownReadPlatformServiceImpl.java
##########
@@ -78,8 +78,9 @@ public SmsCampaignDropdownReadPlatformServiceImpl(final 
SmsConfigUtils smsConfig
             ResponseEntity<Collection<SmsProviderData>> responseOne = 
restTemplate.exchange(uri, HttpMethod.GET, entity,
                     new 
ParameterizedTypeReference<Collection<SmsProviderData>>() {});
             smsProviderOptions = responseOne.getBody();
-            if (!responseOne.getStatusCode().equals(HttpStatus.OK)) {
-            }
+            //Better approch? Maybe log/throw exception that this happen?

Review comment:
       let's throw some suitable exception in this case, don't just log it (and 
certainly not just ignore it, like the current bad code)

##########
File path: 
fineract-provider/src/main/java/org/apache/fineract/infrastructure/campaigns/sms/service/SmsCampaignDropdownReadPlatformServiceImpl.java
##########
@@ -78,8 +78,9 @@ public SmsCampaignDropdownReadPlatformServiceImpl(final 
SmsConfigUtils smsConfig
             ResponseEntity<Collection<SmsProviderData>> responseOne = 
restTemplate.exchange(uri, HttpMethod.GET, entity,
                     new 
ParameterizedTypeReference<Collection<SmsProviderData>>() {});
             smsProviderOptions = responseOne.getBody();
-            if (!responseOne.getStatusCode().equals(HttpStatus.OK)) {
-            }
+            //Better approch? Maybe log/throw exception that this happen?
+            // if (!responseOne.getStatusCode().equals(HttpStatus.OK)) {
+            // }
         } catch (Exception e) {
         }

Review comment:
       while you are already here anyway, let's get rid of this overly broad ` 
} catch (Exception e) {` as well? see if you can just remove it, or if not, 
make it catch a more specific exception, and then re-throw that. No need to log 
it if you rethrow. As per 
https://github.com/apache/fineract#error-handling-guidelines




----------------------------------------------------------------
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:
[email protected]


Reply via email to