Return the body of HttpOperationExceptions (to view the detail)
See original GitHub issueGiven I use an Azure Rest NuGet (e.g. Power BI) When an HttpOperationException occurs Then I want the body of the response
For example client.Datasets.DeleteDatasetByIdAsync("BAD", "Missing", "None");
Returns “Operation returned an invalid status code ‘Unauthorized’” but using Fiddler I can see there is a more detailed error.
62 {"error":{"code":"UnknownError","pbi.error":{"code":"UnknownError","parameters":{},"details":[]}}} 0
This is also true for other requests that are 404 / 500
This is not just for Power BI
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:16 (4 by maintainers)
Top Results From Across the Web
HttpOperationException.Body Property (Microsoft.Rest)
In this article. Definition; Applies to. C# Copy. public object Body { get; set; } member this.Body : obj with get, set. Public...
Read more >REST API Azure Error: 'Microsoft.Rest.HttpOperationException ...
Rest.HttpOperationException' Operation returned an invalid status code 'Un Authorized'. I have gave view permissions to my app in Azure portal.
Read more >Refresh a Power BI Dataset with PowerShell and a Service ...
I'm using the following pattern, with a Service Principal and a secret (not yet in Azure Key Vault, not sure if that is...
Read more >Seven Tips For Using Swagger And AutoRest Together In ...
Here are a few tips to get nice and clean results using the two together in ASP.NET Core MVC based web services/apps.
Read more >Generating clients for your APIs with AutoRest
!= 404) { var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); ex.Request = new ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would make sense to me to include common http information in an exception by default.
Eagerly awaiting for this to be in the roadmap (1.1?)