GregBoet's avatar
GregBoet
Frequent Visitor
1 year ago
Status:
New

Improve error message for Power BI API export to file method

This is a small feature request for better error messages from the Power BI API. Specifically I am hoping for an improvement in this API call:
- https://learn.microsoft.com/en-us/power-bi/developer/embedded/export-to
- In NuGet package Microsoft.PowerBI.Api, this is PowerBIClient.Reports.ExportToFileInGroup

 

If I call this method and give it a list of pages, and if even one of the pages has a bad PageName (Microsoft.PowerBI.Api.Models.ExportReportPage.PageName) (bad simply in that the PageName doesn't exist in the report), I get an inner exception with message "Operation returned an invalid status code 'BadRequest'". "BadRequest" makes it sound like I've sent malformed JSON or something, whereas the syntax is perfect and one of the page identifiers isn't in the report. The error message should instead say something like "PageName not found in report."

 

This has been a pain point for me. I have a fully functional process (to export PNG assets from a report) can break if when company's Power BI report developers release what they think is an inconsequential change that alters a report identifier. That's not great, but it becomes worse when the API error message doesn't help identify the cause of the problem.

No CommentsBe the first to comment

Recent ideas