It seems difficult to read to me...
Why not just keep things simple like that?
try { return await findSomething(someUid); } catch (e) { If (e.notFound) { return null; } throw e; }
You can still have some complex chaining and keep idiomatic async/await structure :
try { let res1 = await someAsyncStuff() let [res2, res3] = await Promise.all([ asyncStuff1(res1), asyncStuff2(res1) ]); return await finalCalculation( res1, res2, res3); } catch (e) { return understandWhatFailedWhyAndWhatToDoAfterwards(e); }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It seems difficult to read to me...
Why not just keep things simple like that?
You can still have some complex chaining and keep idiomatic async/await structure :