<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

ReferenceConfig throw IllegalStateException when check failed, but consumerModel is still registered.
}
    }
    protected synchronized void init() {
        if (initialized) {
            return;
        }
        initialized = true;
        if (!this.isRefreshed()) {
            this.refresh();
        }
        // 
        initServiceMetadata(consumer);
        serviceMetadata.setServiceType(getServiceInterfaceClass());
        // 
        serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, version));
        Map<String, String> referenceParameters = appendConfig();
        // 
        initServiceAppsMapping(referenceParameters);
        ModuleServiceRepository repository = getScopeModel().getServiceRepository();
        ServiceDescriptor serviceDescriptor;
        if (CommonConstants.NATIVE_STUB.equals(getProxy())) {
            serviceDescriptor = StubSuppliers.getServiceDescriptor(interfaceName);
            repository.registerService(serviceDescriptor);
        } else {
            serviceDescriptor = repository.registerService(interfaceClass);
        }
        consumerModel = new ConsumerModel(serviceMetadata.getServiceKey(), proxy, serviceDescriptor, this,
            getScopeModel(), serviceMetadata, createAsyncMethodInfo());
        repository.registerConsumer(consumerModel);
        serviceMetadata.getAttachments().putAll(referenceParameters);