textileio / js-textile

Textile's JavaScript Libs. Home of ThreadDB, Buckets, and more. Available on npm as `@textile/hub`.
https://textileio.github.io/js-textile/docs
MIT License
85 stars 19 forks source link

Client.getTokenChallenge triggers UncaughtException #1209

Closed kenshyx closed 2 years ago

kenshyx commented 2 years ago

This happens when the callback promise is rejected https://github.com/textileio/js-textile/blob/649303c63430721d8a8e42c02620353c484e90bc/packages/client/src/index.ts#L327.

kenshyx commented 2 years ago

The easiest solution it would be to wrap it with a try{} catch(e){} and reject the promise with the error that was caught.

kenshyx commented 2 years ago

Any thoughts on this @carsonfarmer ?

carsonfarmer commented 2 years ago

Ah good catch (haha). Yes your suggestion looks reasonable, I'll try to get a PR up to fix this ASAP, might not be for a day or two though.