CenterForDigitalHumanities / TinyNode

TinyThings in NodeJS
0 stars 1 forks source link

fix strange try-catch pattern #71

Closed cubap closed 5 months ago

cubap commented 5 months ago

https://github.com/CenterForDigitalHumanities/TinyNode/blob/dcacf574d7dd61c21ce89e3b51edd3c1c8ad6585/tokens.js#L16-L17

This try is the whole function. We can already catch() the errors on the fetch() so we don't need the whole thing wrapped. The fs.readfile() callback could also be used for specific errors, but the second try-catch may be fine.