Skip to content

Commit c70662e

Browse files
author
Andrew Omondi
committed
Update errors
1 parent dd60639 commit c70662e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

docs/errors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ try
1212
}
1313
catch (ODataError odataError)
1414
{
15-
Console.WriteLine(odataError.Error.Code);
16-
Console.WriteLine(odataError.Error.Message);
15+
Console.WriteLine(odataError.Error?.Code);
16+
Console.WriteLine(odataError.Error?.Message);
1717
throw;
1818
}
1919
```
@@ -24,7 +24,7 @@ catch (ODataError odataError)
2424
You can check the status code that caused the error as below.
2525

2626
```csharp
27-
catch (ODataError odataError) when (odataError.ResponseStatusCode.Equals(404))
27+
catch (ODataError odataError) when (odataError.ResponseStatusCode.Equals(HttpStatusCode.NotFound))
2828
{
2929
// Handle 404 status code
3030
}

src/Microsoft.Graph/Enums/GraphErrorCode.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public enum GraphErrorCode
8080
NameAlreadyExists,
8181
/// The action is not allowed by the system.
8282
NotAllowed,
83+
/// The requested item is not not found.
84+
NotFound,
8385
/// The request is not supported by the system.
8486
NotSupported,
8587
/// Parameter Exceeds Maximum Length.

0 commit comments

Comments
 (0)