question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return the body of HttpOperationExceptions (to view the detail)

See original GitHub issue

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

image

This is not just for Power BI

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
devignedcommented, Apr 13, 2016

It would make sense to me to include common http information in an exception by default.

2reactions
eMazeikacommented, Sep 19, 2016

Eagerly awaiting for this to be in the roadmap (1.1?)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found