mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 313783 Log a warning if an external settings provider can't be found for the requested id
This commit is contained in:
parent
41cd409a38
commit
d46eb7e4b7
2 changed files with 13 additions and 3 deletions
|
@ -132,6 +132,9 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
|
|||
|
||||
private CExternalSettingsContainer fContainer;
|
||||
|
||||
/** Stash error messages so we're not too noisy if things go wrong */
|
||||
private static Set<String> failingProvidersMessages;
|
||||
|
||||
private ContainerDescriptor(FactoryDescriptor factoryDr,
|
||||
String containerId,
|
||||
IProject project,
|
||||
|
@ -141,7 +144,12 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
|
|||
try {
|
||||
fContainer = fFactoryDr.getFactory().createContainer(containerId, project, cfgDes, previousSettings);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
if (failingProvidersMessages == null)
|
||||
failingProvidersMessages = new HashSet<String>();
|
||||
// only report the error once per session
|
||||
if (!failingProvidersMessages.contains(e.getMessage()))
|
||||
CCorePlugin.log(e.getMessage());
|
||||
failingProvidersMessages.add(e.getMessage());
|
||||
}
|
||||
if(fContainer == null)
|
||||
fContainer = NullContainer.INSTANCE;
|
||||
|
|
|
@ -179,7 +179,9 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW
|
|||
CExtensionSettingProviderDescriptor dr = getProviderDescriptorMap().get(id);
|
||||
if(dr != null)
|
||||
return dr.getContainer(project, cfgDes, previousSettings);
|
||||
return CExternalSettingsManager.NullContainer.INSTANCE;
|
||||
// Notify the manager that there's no external settings manager matching id.
|
||||
throw new CoreException(CCorePlugin.createStatus("External settings provider: \"" + id + "\" couldn't be found for " + //$NON-NLS-1$//$NON-NLS-2$
|
||||
cfgDes.getProjectDescription().getProject() + ":"+cfgDes.getName())); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static String[] getReferencedProviderIds(ICConfigurationDescription cfg){
|
||||
|
|
Loading…
Add table
Reference in a new issue