Failed external API calls kill the frame, even if that frame doesn't use the awaited data #267
Closed
1 task done
Labels
Needs Reproduction
Misc: Needs Reproduction
Describe the bug
In my use case, I am fetching balances from an external server and then binding in the resulting data to the frame before rendering the image.
However, if the API returns aa 400-based error code, the frame will die with the following error in console:
This is obviously an issue, because the frame should be able to display an error in the case an error occurs.
It seems to me that the only way around this is to have our API return a
200
code, regardless of the result, then pass an error code to display to the user, which is a VERY BAD dev experience.Even if the API call is unrelated to the template being generated, it will kill the frame the moment the 400 code arrives.
I've tested this within a Next.js app, and using straight TS with Vite, and both result in the same issue.
Link to Minimal Reproducible Example
No response
Steps To Reproduce
Add an async await within any
app.frame
, before thec.res
and in the case the endpoint returns a400
series code the frame will display nothing and the console error mentioned above is shown.EX:
Frog Version
0.8.5
TypeScript Version
5.3.3
Check existing issues
Anything else?
No response
The text was updated successfully, but these errors were encountered: