Example usage for org.springframework.statemachine StateContext getException

List of usage examples for org.springframework.statemachine StateContext getException

Introduction

In this page you can find the example usage for org.springframework.statemachine StateContext getException.

Prototype

Exception getException();

Source Link

Document

Gets the exception associated with a context.

Usage

From source file:org.springframework.statemachine.support.StateMachineObjectSupport.java

protected void notifyStateMachineError(StateContext<S, E> stateContext) {
    try {/*from  ww w  .  j ava 2  s.c  om*/
        stateMachineHandlerCallHelper.callOnStateMachineError(getBeanName(), stateContext);
        stateListener.stateMachineError(stateContext.getStateMachine(), stateContext.getException());
        stateListener.stateContext(stateContext);
        if (contextEventsEnabled) {
            StateMachineEventPublisher eventPublisher = getStateMachineEventPublisher();
            if (eventPublisher != null) {
                eventPublisher.publishStateMachineError(this, stateContext.getStateMachine(),
                        stateContext.getException());
            }
        }
    } catch (Throwable e) {
        log.warn("Error during notifyStateMachineError", e);
    }
}