spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.54k stars 604 forks source link

State machine loses exceptions thrown from entry/exit actions of parent state #961

Open azhuchkov opened 3 years ago

azhuchkov commented 3 years ago

If some entry/exit action of state which has nested states throws an exception, no stacktrace will be printed to stdout/stderr as well as no appropriate signal will be received by listener or interceptor - FSM just silently stops.

The only way to catch an error I've found is to use:

.stateEntry(JobStatus.EXECUTION, executionEntryAction(), ctx -> System.err.println("ENTRY ERROR"))
.stateExit(JobStatus.EXECUTION, executionExitAction(), ctx -> System.err.println("EXIT ERROR"))