Skip to content

Commit

Permalink
Improve logging in case of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanpelikan committed Dec 18, 2024
1 parent 2a1a7ec commit 0c9d796
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,21 @@ private DE runInTransaction(
.timeout(Duration.ofMinutes(10))
.send()
.join(5, TimeUnit.MINUTES), // needs to run synchronously
() -> "aggregate: " + aggregateId + "; bpmn-process-id: " + bpmnProcessId));
() -> "UpdateTimeout on '"
+ taskIdToTestForAlreadyCompletedOrCancelled
+ "' for aggregate: "
+ aggregateId
+ "; bpmn-process-id: "
+ bpmnProcessId));
}
publisher.publishEvent(
new Camunda8TransactionProcessor.Camunda8CommandAfterTx(
methodSignature,
() -> runnable.accept(attachedAggregate),
() -> "aggregate: " + aggregateId + "; bpmn-process-id: " + bpmnProcessId));
() -> "aggregate: "
+ aggregateId
+ "; bpmn-process-id: "
+ bpmnProcessId));
} else {
runnable.accept(attachedAggregate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,17 @@ public void processPreCommit(
if ((e instanceof ClientStatusException clientStatusException)
&& (clientStatusException.getStatus().getCode() == Status.NOT_FOUND.getCode())) {
throw new RuntimeException(
"Will rollback because job was already completed/cancelled! Test-command giving status 'NOT_FOUND':\n"
"Will rollback '"
+ event.getSource()
+ "' because job was already completed/cancelled! Test-command giving status 'NOT_FOUND':\n"
+ event.description.get());
} else {
throw new RuntimeException(
"Will rollback because testing for job '{}' failed! Test-command:\n"
+ event.description.get());
"Will rollback because testing for job due to '"
+ event.getSource()
+ "'! Test-command:\n"
+ event.description.get(),
e);
}
}

Expand All @@ -133,8 +138,9 @@ public void processPostCommit(
event.runnable.run();
} catch (Exception e) {
logger.error(
"Could not execute camunda command for '{}'! Manual action required!",
"Could not execute camunda command for '{}' initiated by: {}! Manual action required!",
event.description.get(),
event.getSource(),
e);
}

Expand Down

0 comments on commit 0c9d796

Please sign in to comment.