public void reportError(Throwable t) {
        checkNotNull(t);

        synchronized (lock) {
            LOG.error("Reporting error:", t);
            // do not override the initial exception
            if (error == null) {
                error = t;
            }
            next = null;
            lock.notifyAll();
        }
    }
Reports an exception. The consumer will throw the given exception immediately, if it is
currently blocked in the {@link #pollNext()} method, or the next time it calls that method.

<p>After this method has been called, no call to either {@link #produce( List)} or {@link
#pollNext()} will ever return regularly any more, but will always return exceptionally.</p>

<p>If another exception was already reported, this method does nothing.</p>

<p>For the producer, the Handover will appear as if it was {@link #close() closed}.</p>

@param t The exception to report.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/mongodb-cdc/src/main/java/org/apache/inlong/sort/cdc/mongodb/debezium/internal/Handover.java