2 ms·
Having seen several codebases go from using arbitrary callbacks (two? One with an error arg? Why not both?) To promises/asynchronous/await it's hard to see your
by orf 9y ago
Having seen several codebases go from using arbitrary callbacks (two? One with an error arg? Why not both?) To promises/asynchronous/await it's hard to see your point. The code is cleaner, there is no callback hell with await, in fact no callbacks at all. And yes, you do need to use a try/catch block where appropriate.
Stop trying to emulate a try/catch with ridiculous nested callback passing that inevitably leads to the function not being called and data being lost. Just stop.