adamsaghy commented on code in PR #3803:
URL: https://github.com/apache/fineract/pull/3803#discussion_r1537645331


##########
fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java:
##########
@@ -293,7 +298,12 @@ private void publishHookEvent(final String entityName, 
final String actionName,
                 } else if (result instanceof ErrorInfo ex) {
                     reqmap.put("status", "Exception");
 
+                    if (!isValidJson(ex.getMessage(), type)) {

Review Comment:
   This is wrong... you should do the following:
   wrap around the `gson.fromJson(ex.getMessage(), type)`
   ```
   Map<String, Object> errorMap;
   try {
          errorMap = gson.fromJson(ex.getMessage(), type);
   } catch (Exception e) {
           errorMap.put("errorMessage", ex.getMessage());
     }
   errorMap.put("errorCode", ex.getErrorCode());
   errorMap.put("statusCode", ex.getStatusCode());
      ```
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to