0

I'm following the documentation (State Machine Error Handling) to implement error handling. However, when an exception occurs it is propagated up rather than intercepted. I tried using the interceptor, the listener and the @OnStateMachineError without any success. Debugging the code, neither MethodInvokingStateMachineRuntimeProcessor.java:52 or any of its callers have any specific logic to handle errors.

Replicating the issue is simple, just create a state machine (I'm using the latest snapshot) and register the bean:

@WithStateMachine
public class ExceptionThrowingAction {
    @OnTransition
    public void throwError(@EventHeaders Map<String, Object> headers, ExtendedState extendedState) {
        throw new RuntimeException("test error");
    }
}

Am I missing something or is it a genuine bug? If so, I'll raise as an issue

1 Answers1

0

Yes, this is a bug. We've done a lot of changes in master to harden there user level hooks. None of those should break machine execution. Please raise an issue and we'll fix it.

Janne Valkealahti
  • 2,552
  • 1
  • 14
  • 12