Skip to content

Commit

Permalink
Show parsed value in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasArdal committed Nov 14, 2023
1 parent 426760b commit f1e5c8c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ A little helper resolving extended information from HResults.
```csharp
try
{
// ...
throw new ApplicationException();
}
catch (Exception ex)
{
HResult hresult = HResult.Parse(ex.HResult);
Console.WriteLine(hresult.Hex);
Console.WriteLine(hresult.IsFailure);
Console.WriteLine(hresult.Facility);
Console.WriteLine(hresult.ErrorCode);
Console.WriteLine(hresult.Hex); // 0x80131600
Console.WriteLine(hresult.IsFailure); // true
Console.WriteLine(hresult.Facility); // FACILITY_URT
Console.WriteLine(hresult.ErrorCode); // COR_E_APPLICATION
}
```

0 comments on commit f1e5c8c

Please sign in to comment.