Browse Source

remove catch all from PerformanceCounterDescriptor.GetProcessInstanceName and add explanations for the different exception types

pull/18/head
Siegfried Pammer 14 years ago
parent
commit
2f0119463b
  1. 11
      src/AddIns/Analysis/Profiler/Controller/Data/PerformanceCounterDescriptor.cs

11
src/AddIns/Analysis/Profiler/Controller/Data/PerformanceCounterDescriptor.cs

@ -108,7 +108,16 @@ namespace ICSharpCode.Profiler.Controller.Data @@ -108,7 +108,16 @@ namespace ICSharpCode.Profiler.Controller.Data
return instance;
}
}
} catch (Exception) {
// These exceptions happen when something is wrong with the system settings or the perfmon service is not started.
// We will ignore performance counters in those cases.
} catch (Win32Exception) {
// Win32Exception (0x80004005): The service cannot be started, either because it is disabled
// or because it has no enabled devices associated with it
// see http://community.sharpdevelop.net/forums/p/10709/29534.aspx#29534
return null;
} catch (InvalidOperationException) {
// InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
// see http://community.sharpdevelop.net/forums/p/14180/37895.aspx#37895 and SD-1819
return null;
}

Loading…
Cancel
Save