diff --git a/docs/errors.md b/docs/errors.md index 94a026e6b2e..bdcce4bafa9 100644 --- a/docs/errors.md +++ b/docs/errors.md @@ -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 }