File tree Expand file tree Collapse file tree
src/Microsoft.Graph/Enums Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212}
1313catch (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)
2424You 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 }
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments