class FsmEventProcessor implements EventProcessor {

    @Override
    public void submit(Object event) {
        requireNonNull(event);

        try {
            stateMachine.handle(event, loggingPrefix);
        } catch (Throwable cause) {
            String eventName = event.getClass().getSimpleName();
            LOGGER.error("{} {} -> ???: Exception occurred while processing event={}. Cause=\"{}\"",
                    new Object[]{loggingPrefix, stateMachine.currentState(), eventName, cause});

            errorHandler.accept(cause, stateMachine.currentState());
        }
    }

    public  FsmEventProcessor(StateMachine<S> stateMachine, BiConsumer<Throwable, S> errorHandler, String loggingPrefix);

}