private void updateTimerAndCheckExpiry(Timer timer, String errorMessageIfExpired) {
        timer.update();
        if (timer.isExpired()) {
            log.error(errorMessageIfExpired);
            throw new ConnectException(errorMessageIfExpired);
        }
    }
Update the provided timer, check if it's expired and throw a {@link ConnectException} with the provided error
message if it is.

@param timer {@link Timer} to check
@param errorMessageIfExpired error message indicating the cause for the timer expiry
@throws ConnectException if the timer has expired
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java