From ca13f7d716d93c7227829cbbdfc33affa13d9d5f Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Mon, 23 Sep 2024 11:41:59 +0200 Subject: [PATCH] [Fix #3677] Removing exception type from error message --- .../workflow/instance/impl/WorkflowProcessInstanceImpl.java | 3 +-- .../serverless/workflow/actions/ErrorExpressionAction.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java index 79ef9e1d070..7e972ac5267 100755 --- a/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java +++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/impl/WorkflowProcessInstanceImpl.java @@ -1163,8 +1163,7 @@ public void setErrorState(NodeInstance nodeInstanceInError, Exception e) { this.nodeIdInError = nodeInstanceInError.getNodeDefinitionId(); this.nodeInstanceIdInError = nodeInstanceInError.getId(); this.errorCause = Optional.of(e); - Throwable rootException = getRootException(e); - this.errorMessage = rootException.getClass().getCanonicalName() + " - " + rootException.getMessage(); + this.errorMessage = getRootException(e).getMessage(); setState(STATE_ERROR); logger.error("Unexpected error while executing node {} in process instance {}", nodeInstanceInError.getNode().getName(), this.getStringId(), e); ((InternalProcessRuntime) getKnowledgeRuntime().getProcessRuntime()).getProcessEventSupport().fireOnError(this, nodeInstanceInError, getKnowledgeRuntime(), e); diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java b/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java index a4b1f1da11d..33926e40439 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-runtime/src/main/java/org/kie/kogito/serverless/workflow/actions/ErrorExpressionAction.java @@ -40,7 +40,7 @@ public void execute(KogitoProcessContext context) throws Exception { } } } else { - setError(context, expr.toString()); + setError(context, "The expression used for generating error message is not a valid one: " + expr.asString()); } }