@Deprecated
    void onError(Object payload, Exception e) {
        DynamicOptions dynamicOptions = trpDynamicOptions.get();
        if (dynamicOptions == null && onErrorAction == OnErrorAction.WAIT) {
            LOG.error("Error on '" + siddhiAppContext.getName() + "'. Dropping event at Sink '"
                    + type + "' at '" + streamDefinition.getId() + "' as its does not support 'WAIT' "
                    + "as it uses deprecated onError(Object payload, Exception e) method!, "
                    + "events dropped '" + payload + "'");
        } else {
            onError(payload, dynamicOptions, e);
        }
    }
Called at the end to clean all the resources consumed
modules/siddhi-core/src/main/java/io/siddhi/core/stream/output/sink/Sink.java