I finally found some time to document best practices for error handling with async/await . http://npmjs.org/resultify and also http://npmjs.org/error I still love THE error handling guide from joyent https://www.joyent.com/node-js/production/design/errors … but it doesnt mention async / await.
-
-
Replying to @Raynos
My problem with that approach is that it uses even more promises than await :/, and more microticks as well.
4 replies 0 retweets 0 likes -
Replying to @matteocollina
Can you explain why a promise returning { err, data } uses more promises then async / await.
2 replies 0 retweets 0 likes -
Replying to @Raynos
your resultifyPromise has a .then() method. It creates a Promise and it “loses” a microtick.
1 reply 0 retweets 0 likes -
Replying to @matteocollina
What if I just monkey patch the then method on the original promise to avoid allocating a new promise :D that should work nicely.
1 reply 0 retweets 0 likes -
Replying to @Raynos
It won’t. If you change .then() (or use a non-native Promise), using await allocates one more promise and microtick internally
1 reply 0 retweets 0 likes -
-
Replying to @Raynos
They are great tbh. They have enabled more people to write JS code. They also require people with expertise to wrangle them to reality. To sum up, they have created jobs.
1 reply 0 retweets 1 like -
Replying to @matteocollina
This is Matteo the consultant talking
I don’t want to hire you to fix my code. I want to write code without footguns please.
Is rust ready yet ?1 reply 0 retweets 2 likes -
Replying to @Raynos
I think the answer
@yoshuawuyts would give is yes! (You would hear a meow in the background tho)1 reply 0 retweets 1 like
Haha, "ready" is a gradient tho. It's continuously improving, and async Rust is much less an expert-only zone than it was a year ago. But the web ecosystem is nowhere near as developed as Node's is, which means if you want to be writing Rust for web you'll def be *writing* Rust.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.