I got bitten today by a nasty #JavaScript thing:
const handler = async () => { try { return request(); } catch (err) { // I
wanted to handle request errors here // but since request returns a promise //
they won't get caught } };
A static archive of Markus Tacker's tweets. Follow me on Mastodon: @[email protected].
I got bitten today by a nasty #JavaScript thing:
const handler = async () => { try { return request(); } catch (err) { // I
wanted to handle request errors here // but since request returns a promise //
they won't get caught } };
The important change to make it work is: