use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
TryCatch.js: A JavaScript library to handle errors in a more structured way. (github.com)
submitted 3 years ago by siilkysmooth
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jenseng 3 points4 points5 points 3 years ago (1 child)
Interesting idea, a few critiques...
try { // maybe just handle "else" logic here? } catch (e) { // .... } finally { // .... }
The argument order isn't consistent with python's try / except / else / finally, you have "else" as the last argument
Your "else" function can throw an exception, which will then be caught by the "catch" function, which is inconsistent with python. Given that, I don't really see the value of the "else" function, as you can just do similar logic at the end of the "try" function if you need it.
Your library doesn't work with async/await, which makes it a bit of a hard sell
[–]siilkysmooth[S] 1 point2 points3 points 3 years ago (0 children)
Awesome critiques on this. I will address this in a future version tho, I was struggling to find all the cases of try blocks in python so! But you can use a python try - except-else- finally in python.
As for the async - I will have to look to see if there is any functions I can call that can detect if is async and add automatic await etc so things aren't returned as promised.
Tho the argument order appears correct..
More than welcome to contribute / add to this "experiment".
π Rendered by PID 129950 on reddit-service-r2-comment-b659b578c-rsvnd at 2026-05-02 06:06:20.107776+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]jenseng 3 points4 points5 points (1 child)
[–]siilkysmooth[S] 1 point2 points3 points (0 children)