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

reactive error handling #997

Open pietermartin opened 3 years ago

pietermartin commented 3 years ago

Is it possible to have the error handling go via reactive's doOnError Already doOnComplete fires but doOnError is swallowed. Seems to me the only way to get the StateMachineEventResult is to block.

StateMachineEventResult<String, String> result = activityRecord.triggerHandleSignal()
    .subscribeOn(ICmStateMachine.TRIGGER_THREADS)
    .doOnComplete(() -> {
    })
    .doOnError(throwable -> {
    })
    .blockLast();

Would it not be better if the exception propogates to doOnError?

Thanks