Skip to content

Commit

Permalink
Merge pull request #2121 from microsoftgraph/andrueastman-patch-1
Browse files Browse the repository at this point in the history
Update errors.md to do case insensitive comparison
  • Loading branch information
andrueastman authored Sep 7, 2023
2 parents e83fc4a + 97f77ad commit e716923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ catch (ODataError odataError) when (odataError.ResponseStatusCode == (int)HttpSt
There are a few different types of errors that can occur during a network call. These most common error codes are defined in [GraphErrorCode.cs](../src/Microsoft.Graph/Enums/GraphErrorCode.cs). These can be checked by matching with the error code value as below.

```csharp
catch (ODataError odataError) when (odataError.Error.Code.Equals(GraphErrorCode.AccessDenied.ToString()))
catch (ODataError odataError) when (odataError.Error.Code.Equals(GraphErrorCode.AccessDenied.ToString(),StringComparison.OrdinalIgnoreCase))
{
// Handle access denied error
}
Expand Down

0 comments on commit e716923

Please sign in to comment.