You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Whenever the graph interface returns a 4XX or 5XX status code it will be deserialized into an ODataError exception, containing the corresponding error including all received information within the property Error. The outer exception has also a message property, but it always contains only the message Exception of type 'Microsoft.Graph.Models.ODataErrors.ODataError' was thrown..
Whenever this error happens at runtime on places where we didn't expect them, all we can see in generic visualizers of exceptions (e.g. Application Insights or a Hangfire Failed Job) is something like this:
Microsoft.Graph.Models.ODataErrors.ODataError: Exception of type 'Microsoft.Graph.Models.ODataErrors.ODataError' was thrown.
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.ThrowIfFailedResponse(HttpResponseMessage response, Dictionary'2 errorMapping, Activity activityForAttributes)
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory'1 factory, Dictionary'2 errorMapping, CancellationToken cancellationToken)
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.SendAsync[ModelType](RequestInformation requestInfo, ParsableFactory'1 factory, Dictionary'2 errorMapping, CancellationToken cancellationToken)
This information is useless, cause we can't immeditately see, what the error response was from graph itself. Instead we have to dig deeper or locally rerun the given method and hope we will see the same error again.
Describe the solution you'd like
It would be much easier, if the message property of the ODataError would contain the very same error message that Error.Message contains. Maybe even better would be something like $"{Error.Code}: {Error.Message}" if available. If the returned error doesn't contain any such information the fallback to the given generic error message would be sufficient.
Describe alternatives you've considered
In our case we mostly look at App Insights or Hangfire failed jobs, which visualize the exception in a generic way by only showing the exception type and the content of the exception message property. We could enhance both places to check for the concrete exception type and in case of being an ODataError, visualize the inner Error property. But that would mean, that everybody has to take care for this specific exception type in all places where they are visualized (e.g. Loggers, etc.)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Whenever the graph interface returns a 4XX or 5XX status code it will be deserialized into an ODataError exception, containing the corresponding error including all received information within the property
Error
. The outer exception has also a message property, but it always contains only the messageException of type 'Microsoft.Graph.Models.ODataErrors.ODataError' was thrown.
.Whenever this error happens at runtime on places where we didn't expect them, all we can see in generic visualizers of exceptions (e.g. Application Insights or a Hangfire Failed Job) is something like this:
This information is useless, cause we can't immeditately see, what the error response was from graph itself. Instead we have to dig deeper or locally rerun the given method and hope we will see the same error again.
Describe the solution you'd like
It would be much easier, if the message property of the ODataError would contain the very same error message that
Error.Message
contains. Maybe even better would be something like$"{Error.Code}: {Error.Message}"
if available. If the returned error doesn't contain any such information the fallback to the given generic error message would be sufficient.Describe alternatives you've considered
In our case we mostly look at App Insights or Hangfire failed jobs, which visualize the exception in a generic way by only showing the exception type and the content of the exception message property. We could enhance both places to check for the concrete exception type and in case of being an
ODataError
, visualize the inner Error property. But that would mean, that everybody has to take care for this specific exception type in all places where they are visualized (e.g. Loggers, etc.)The text was updated successfully, but these errors were encountered: