I just wrote a reply on Medium to this article: https://medium.com/@fpresencia/please-mix-promises-and-callb...
Takeaways:
- It has the wrong signature! The callback is the second parameter but is being passed as the first, so it will never be called.
- Even if that's a typo, don't catch what you intend to throw as an exception. Use the callback as the second parameter of the `then` and let it fail. The error will stil l be swallowed, but in a more predictable way.
- Better yet, use async/await if possible! It makes promises a joy to work with.