Skip to content

Commit 2790692

Browse files
authored
Improve signal processing error and log (#535)
* Improve signal processing error and log * Remove closed check in stack trace.
1 parent f984029 commit 2790692

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/main/java/com/uber/cadence/internal/sync/DeterministicRunnerImpl.java

-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ public String stackTrace() {
380380
StringBuilder result = new StringBuilder();
381381
lock.lock();
382382
try {
383-
checkClosed();
384383
for (WorkflowThread coroutine : threads) {
385384
if (result.length() > 0) {
386385
result.append("\n");

src/main/java/com/uber/cadence/internal/sync/POJOWorkflowImplementationFactory.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ public void processSignal(String signalName, byte[] input, long eventId) {
322322
newInstance();
323323
signalMethod.invoke(workflow, args);
324324
} catch (IllegalAccessException e) {
325-
throw new Error("Failure processing \"" + signalName + "\" at eventID " + eventId, e);
325+
String errorMessage =
326+
"Failed to process signal \"" + signalName + "\" at eventID " + eventId + ".";
327+
log.error(errorMessage + "\n" + e);
328+
throw new Error(errorMessage + " Check cause for details.", e);
326329
} catch (DataConverterException e) {
327330
logSerializationException(signalName, eventId, e);
328331
} catch (InvocationTargetException e) {
@@ -332,8 +335,10 @@ public void processSignal(String signalName, byte[] input, long eventId) {
332335
} else if (targetException instanceof Error) {
333336
throw (Error) targetException;
334337
} else {
335-
throw new Error(
336-
"Failure processing \"" + signalName + "\" at eventID " + eventId, targetException);
338+
String errorMessage =
339+
"Failed to process signal \"" + signalName + "\" at eventID " + eventId + ".";
340+
log.error(errorMessage + "\n" + targetException);
341+
throw new Error(errorMessage + " Check cause for details.", targetException);
337342
}
338343
}
339344
}

0 commit comments

Comments
 (0)