protected static String reflectiveErrorDescription(Throwable t) {
        if (t instanceof NoSuchMethodException) {
            return ": Plugin class must have a no-args constructor, and cannot be a non-static inner class";
        } else if (t instanceof SecurityException) {
            return ": Security settings must allow reflective instantiation of plugin classes";
        } else if (t instanceof IllegalAccessException) {
            return ": Plugin class default constructor must be public";
        } else if (t instanceof ExceptionInInitializerError) {
            return ": Failed to statically initialize plugin class";
        } else if (t instanceof InvocationTargetException) {
            return ": Failed to invoke plugin constructor";
        } else if (t instanceof LinkageError) {
            return ": Plugin class has a dependency which is missing or invalid";
        } else {
            return "";
        }
    }
Helper to evaluate a {@link ServiceLoader} operation while handling {@link LinkageError}s.

@param type The plugin type which is being loaded
@param function A function on a {@link ServiceLoader}'s {@link Iterator} which may throw {@link LinkageError}
@return the return value of function
@throws Error errors thrown by the passed-in function
@param <U> Return value of the passed-in function
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginScanner.java