Translate HRESULT error codes from the DiagnosticClient into human-readable exceptions
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 404
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 35
Description
We should translate the HRESULT exception codes we receive from `DiagnosticClient` into meaningful human-readable descriptions of the codes.
## Background and Motivation
When we get an error from the `DiagnosticClient` it will look something like this:
```
=> TargetProcessId:11588 TargetRuntimeInstanceCookie:8fc502a39434444ab2c67aaed1b27a5b CollectionRuleName:LoadAllocationProfiler => CollectionRuleTriggerType:Startup => CollectionRuleActionType:LoadProfiler CollectionRuleActionIndex:0
Collection rule 'LoadAllocationProfiler' action 'LoadProfiler' failed.
Microsoft.Diagnostics.Tools.Monitor.CollectionRules.Exceptions.CollectionRuleActionException: SetStartupProfilerAsync failed - HRESULT: 0x8013135B
```
## Proposed Feature
We should translate the code 0x8013135B into it's description "Not Yet Available". Full list of codes here: [dotnet/runtime:/src/native/eventpipe/ds-types.h: line 127](https://github.com/dotnet/runtime/blob/c4d5f6dff367ba1197358e5abd0d50d8b10a3fef/src/native/eventpipe/ds-types.h#L127)
The example above would look something like this:
```
=> TargetProcessId:11588 TargetRuntimeInstanceCookie:8fc502a39434444ab2c67aaed1b27a5b CollectionRuleName:LoadAllocationProfiler => CollectionRuleTriggerType:Startup => CollectionRuleActionType:LoadProfiler CollectionRuleActionIndex:0
Collection rule 'LoadAllocationProfiler' action 'LoadProfiler' failed.
Microsoft.Diagnostics.Tools.Monitor.CollectionRules.Exceptions.CollectionRuleActionException: SetStartupProfilerAsync failed - IPC Command Not Yet Available (HRESULT: 0x8013135B)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.