microsoftgraph / msgraph-beta-sdk-dotnet

The Microsoft Graph Client Beta Library for .NET supports the Microsoft Graph /beta endpoint. (preview)
Other
95 stars 32 forks source link

Graph SDK V5: Default RetryHandler does not provide info on why it failed #816

Closed DCourtel closed 6 months ago

DCourtel commented 6 months ago

The default retry handler simply throws an InvalidOperationException exception when it reaches the maximum retry count. The error message is simply set to: «Too many retries performed.» and the inner exception simply states: «More than {retryCount} retries encountered while sending the request.» There is no way to know why retries have been performed. What were the error codes and error messages?

The retry handler should return an AggregateException (or a specific exception like TooManyRetriesException) with one exception per retry specifying the HTTP status and the error code returned by the server.

Thanks.

Source: Microsoft.Kiota.Http.HttpClientLibrary.Middleware.RetryHandler

andrueastman commented 6 months ago

Thanks for raising this @DCourtel

I believe this is a valid ask. As this is related to the http library, we'll close this here and track this from the library via https://github.com/microsoft/kiota-http-dotnet/issues/221