Skip to content

Commit

Permalink
Update errors.md
Browse files Browse the repository at this point in the history
Convert HttpStatusCode.NotFound to INT before comparing with odataError.ResponseStatusCode
  • Loading branch information
guanlx authored Aug 21, 2023
1 parent 4693ab4 commit cbc3d9e
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 @@ -24,7 +24,7 @@ catch (ODataError odataError)
You can check the status code that caused the error as below.

```csharp
catch (ODataError odataError) when (odataError.ResponseStatusCode.Equals(HttpStatusCode.NotFound))
catch (ODataError odataError) when (odataError.ResponseStatusCode == (int)HttpStatusCode.NotFound)
{
// Handle 404 status code
}
Expand Down

0 comments on commit cbc3d9e

Please sign in to comment.