autorest: Return the body of HttpOperationExceptions (to view the detail)
Given 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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 16 (4 by maintainers)
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?)
Looks like you can