Error handling on async + callback codebases

if you have both newer async/await code ref async article as well as callback style code:

what you need to remember is this

as long as something returns new Promise(...), or you know the library method/function call returns a Promise, your async/await code will be able to catch them all at the top.

the catch block on top is like en error-catching net that covers all eventualities (regarding errors), and does not require you to interface with older async code to handle them individually.

steps to find out if your callback functions have error

  1. find out where that function is called
  2. repeat step 1 until you find a try/catch
  3. if the catch block either handles all errors generically or handles errors by type, you're golden.