Hi @Chris Zohno
In SDK 5.0 and above, I recommend that you use OdataError
instances to catch exceptions.
try
{
var exuser = await graphClient.Users["******@xxxxxx.onmicrosoft.com"].GetAsync();
}
catch (ODataError odataError)
{
Console.WriteLine(odataError.Error.Code);
Console.WriteLine(odataError.Error.Message);
}
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.