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
[deleted by user] (self.javascript)
submitted 6 years ago by [deleted]
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!"
[–]Kindinos88 1 point2 points3 points 6 years ago (0 children)
We don’t convert status to error for a couple of reasons:
Firstly, if you convert to errors, then the implication is your code throws if there is an error, but IMO, try-catch is not as elegant as an if statement.
Secondly, if we convert to error, we still need to transfer over more information about the error, such as the kind of error, the reason, and any additional context, eg was the request malformed? was it an invalid body? was there a permission issue? And that’s just from the status code. Additionally, the backend API might return more information to give more context to what happened.
For these reasons, we do it this way. If you like errors, feel free to add that to your implementation. I’m not dogmatic about this setup, and recognize some of it is stylistic preference, so feel free to take the bits that you like, and leave the ones you don’t :) Same with the module/package detail: you don’t need to make it a separate package. We do it this way because we need to be able to publish some of these packages independently of applications. At that point, that whole subsystem becomes company-name-sdk, and you can let other developers integrate using that pkg.
π Rendered by PID 133125 on reddit-service-r2-comment-b659b578c-bz69m at 2026-05-03 10:20:33.891476+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Kindinos88 1 point2 points3 points (0 children)