public ApiException exception(String message) {
        if (message == null) {
            // If no error message was specified, return an exception with the default error message.
            return exception;
        }
        // Return an exception with the given error message.
        return builder.apply(message);
    }
Create an instance of the ApiException that contains the given error message.

@param message    The message string to set.
@return           The exception.
clients/src/main/java/org/apache/kafka/common/protocol/Errors.java