supertokens / supertokens-node

Node SDK for SuperTokens core
https://supertokens.com
Other
278 stars 72 forks source link

fix: error handling in doFetch #864

Closed anku255 closed 2 weeks ago

anku255 commented 2 weeks ago

Summary of change

In #835 we had added a workaround to retry request without the cache field if it was not available. We were not awaiting the response and prevents the catch block from catching the error.

For some reason it worked fine locally and even on CF (for sometime) until it started breaking recently. Adding await fixes the issue.

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates