public static void storeErroneousEvent(ErrorStore errorStore, ErrorOccurrence occurrence, String siddhiAppName,
                                           Object erroneousEvent, String streamName) {
        if (errorStore != null && erroneousEvent != null) {
            switch (getErrorType(occurrence)) {
                case MAPPING:
                    if (erroneousEvent instanceof List) {
                        errorStore.saveMappingError(siddhiAppName, (List<ErroneousEvent>) erroneousEvent,
                                streamName);
                    }
                    break;
                case TRANSPORT:
                    errorStore.saveTransportError(siddhiAppName, (ErroneousEvent) erroneousEvent,
                            getErroneousEventType(((ErroneousEvent) erroneousEvent).getEvent()), streamName,
                            occurrence);
                    break;
            }
        }
    }
Sends an erroneous event to the error store in order to save that.

@param errorStore     Error store object.
@param occurrence     Occurrence point of the error.
@param siddhiAppName  Siddhi app name.
@param erroneousEvent The event which was collected due to an error.
@param streamName     The stream from which, error was collected.
modules/siddhi-core/src/main/java/io/siddhi/core/util/error/handler/util/ErrorStoreHelper.java