private static Class<?>[] getDeclaredExceptions0(
            Type type, Class<?> funcClass, String methodName) {

        final String ifaceTypeName = typeName(type, funcClass, methodName, "Iface");
        try {
            final Class<?> ifaceType = Class.forName(ifaceTypeName, false, funcClass.getClassLoader());

            // Check and convert to camel, thrift java compiler only support underscored to camel
            final String methodNameCamel = getCamelMethodName(methodName);
            for (Method m : ifaceType.getDeclaredMethods()) {
                if (m.getName().equals(methodName) || m.getName().equals(methodNameCamel)) {
                    return m.getExceptionTypes();
                }
            }
            throw new IllegalStateException("failed to find a method: " + methodName);
        } catch (Exception e) {
            throw new IllegalStateException(
                    "cannot determine the declared exceptions of method: " + methodName, e);
        }
    }
Sets the exception field of the specified {@code result} to the specified {@code cause}.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/common/thrift/ThriftFunction.java