Echo JS 0.11.0

<~>

kirilloid 2142 days ago. link 1 point
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.
sbruchmann 2145 days ago. link 1 point
Why use a built-in language feature when a third-party solution is just one `npm install` away, amirite?
DrJume 2145 days ago. link 1 point
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.
DrJume 2145 days ago. link 1 point
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 :)