Skip to content

Commit

Permalink
#253 - Improve error message when document action fails (#254)
Browse files Browse the repository at this point in the history
* #253 - Improve error message when document action fails

* #253 - Improve error message when document action fails
  • Loading branch information
d-ruiz authored Oct 9, 2024
1 parent dda6e8d commit 0dbb667
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ public Response create(String tableName, String jsonText) {
String processError = runDocAction(po, jsonObject, processMsg);
if (!Util.isEmpty(processError, true)) {
trx.rollback();
return ResponseUtils.getResponseError(Status.INTERNAL_SERVER_ERROR, "Can't perform document action", "Encounter exception during execution of document action: ", processError);
log.warning("Encounter exception during execution of document action in REST: " + processError);
return ResponseUtils.getResponseError(Status.INTERNAL_SERVER_ERROR, Msg.getMsg(po.getCtx(), "FailedProcessingDocument"), processError, "");
}
trx.commit(true);
po.load(trx.getTrxName());
Expand Down Expand Up @@ -474,7 +475,8 @@ public Response update(String tableName, String id, String jsonText) {
trx.commit(true);
} else {
trx.rollback();
return ResponseUtils.getResponseError(Status.INTERNAL_SERVER_ERROR, "Can't perform document action", "Encounter exception during execution of document action: ", error);
log.warning("Encounter exception during execution of document action in REST: " + error);
return ResponseUtils.getResponseError(Status.INTERNAL_SERVER_ERROR, Msg.getMsg(po.getCtx(), "FailedProcessingDocument"), error, "");
}

po.load(trx.getTrxName());
Expand Down Expand Up @@ -853,7 +855,7 @@ private String runDocAction(PO po, JsonObject jsonObject, StringBuilder processM
if (!Util.isEmpty(docAction, true) && !DocAction.ACTION_None.equals(docAction)) {
ProcessInfo processInfo = MWorkflow.runDocumentActionWorkflow(po, docAction);
if (processInfo.isError()) {
return processInfo.getSummary();
return Msg.parseTranslation(po.getCtx(), processInfo.getSummary());
} else {
try {
po.saveEx();
Expand Down

0 comments on commit 0dbb667

Please sign in to comment.