Uncaught error bubbles up to the app
Sparragus opened this issue · 5 comments
If the proxy is unreachable when it's offline or blocked by the client, for example, this fetch
will throw a runtime error that reaches the app.
unleash-proxy-client-js/src/metrics.ts
Lines 72 to 81 in c040f14
I suggest we implement a try/catch just like it's being done in index.ts
.
unleash-proxy-client-js/src/index.ts
Lines 253 to 288 in d1d4ad2
As a side-note, on Next.js apps, this is very bothersome during development because it shows a modal displaying uncaught runtime errors.
Makes sense @Sparragus 👍🏼
I often forget that fetch uses a mix of throw and unsuccessful response codes, which often feels a bit clunky to get right.
Generally the SDK should try to throw in any operation that happens in the background.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@ivarconr This seems like something we should be able to rectify. Should we reopen and mark as a bug that we can fix? What do you think?
Following as well. We are seeing these errors in our error loggings too. (edit: we use react sdk client)
Should be fixed in the following versions:
unleash-proxy-client-js v2.1.0
@unleash/proxy-client-vue v0.0.4
@unleash/proxy-client-svelte v0.0.4
@unleash/proxy-client-react v3.3.0