From 7d3d4712a9442aa16d7bd3e61283ab5b2299a837 Mon Sep 17 00:00:00 2001 From: Thomas Ardal Date: Tue, 14 Nov 2023 12:16:59 +0100 Subject: [PATCH] Usage in readme --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a51274f..9ae557c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # Elmah.Io.HResults -A little helper resolving extended information from HResults +A little helper resolving extended information from HResults. + +## Usage + +```csharp +try +{ + // ... +} +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); +} +``` \ No newline at end of file