private static boolean shouldHalt(Throwable t) {
        // s3stream will retry all retryable exceptions, so we should halt all exceptions.
        // AlwaysSuccessClient could be removed later.
        if (t instanceof KafkaException) {
            return true;
        }
        if (!(t instanceof StreamClientException)) {
            return false;
        }
        StreamClientException e = (StreamClientException) t;
        return HALT_ERROR_CODES.contains((short) e.getCode());
    }
Check if the exception is a ElasticStreamClientException with a halt error code.

@param t the exception
@return true if the exception is a ElasticStreamClientException with a halt error code, otherwise false
core/src/main/scala/kafka/log/streamaspect/ClientWrapper.java