private void onError(List<Event> eventBuffer, Exception e) {
        if (exceptionListener != null) {
            exceptionListener.exceptionThrown(e);
        }
        switch (onErrorAction) {
            case LOG:
                for (Event event : eventBuffer) {
                    log.error("Error in SiddhiApp '" + siddhiAppName +
                            "' after consuming events from Stream '" + streamName + "', " + e.getMessage() +
                            ". Hence, dropping event '" + event.toString() + "'", e);
                }
                break;
            case STREAM:
                for (Event event : eventBuffer) {
                    if (faultStreamJunction != null) {
                        faultStreamJunction.sendEvent(event);
                    } else {
                        log.error("Error in SiddhiApp '" + siddhiAppName +
                                "' after consuming events from Stream " +
                                "'" + streamName + "', " + e.getMessage()
                                + ". Siddhi Fault Stream for '" + streamName + "' is not defined. "
                                + "Hence dropping the event '" + event.toString() + "'", e);
                    }
                }
                break;
            default:
                break;
        }
    }
Interface to be implemented to receive events via handlers.
modules/siddhi-core/src/main/java/io/siddhi/core/util/event/handler/StreamHandler.java