Forum Discussion
Checking request status and using the result without doubling server calls
Hi LPGiroux ,
If not want to use a double call, you can try to handle with these errors manually by creating an error table in Power Query.
Refer:
- Handling HTTP Errors in Power Query and Power BI
- Handling 404–Not Found Errors With Web.Contents() In Power Query And Power BI
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- LPGiroux4 years agoFrequent Visitor
Hi v-yingjl,
Thank you for taking the time to answer.
The technique from the first video is using ManualStatusHandling, this is already what I’m doing (set in the options variable before calling my function). Then, we are both calling Value.Metadata to get the status code. The handling of the errors with a static table or custom code doesn’t change the fact that if the call is valid, I still need to call Text.FromBinary if I want to du something with the result. Calling Text.FromBinary and Value.Metadata causes the double call.Any other idea?
- LPGiroux4 years agoFrequent Visitor
To give more precision, if status code is not 200, the calling function will extract the error message and build a custom response base on both the message and static values. The retry loop show in the code is only to handle the rate limiting error 429.
Thanks again for trying!