It’s funny, how it goes back to node style (which they copied from Go, probably) of (error, result).
Also don’t understand how did you get try/catch hell — exceptions propagate through as much nesting as needed—one just need to compose Promises properly.
It allows to program with catching errors as seen in Googles language Go.
They don't use the cascading try catch block, but instead a inline solution, where the execution of a function returns two values at once: the data and error.
With this you can easily handle the error without cascading try catch blocks.
My library (size of 1 script) tries to emulate this coding pattern.
The motivation of this little snippet is to be a wrapper, which tries your function or promise, so that you have cleaner code.
Supposing you use try and catch on every exection of a promise or function and attach a console log with an error code, this library does it for you.
You don't need to npm install it: just copy the script :)