Didn't realize until posting here that apparently Firefox blocks the reddit api from the browser in certain common configurations. So maybe that would have been useful.
Didn't realize until posting here that apparently Firefox blocks the reddit api from the browser in certain common configurations. So maybe that would have been useful.
IMO if a website displays a loading message indefinitely then this isn’t error handling.
I’d say that showing accurate feedback is part of proper error handling; like the one you suggested:
> I suppose I could have added a "it seems we can't reach Reddit" kind of message,
Not that a hobby project needs error handling, it’s cool even without it.
In the function fetchRedditStories, it looks like that the callback param in the catch is named `e`, but it tries to log `error`.
Checking the network panel I'm getting a 200, but I'm pretty sure it's failing anyway because of the ReferenceError
The underlying problem here is using Javascript instead of TypeScript.
And of course under that problem there's the problem of Javascript bit being TypeScript in the first place.
(Not a bad word about Brendan Eich though, considering that the language was created by one man in three weeks it is amazing, but it is still sad that we ended up with an untyped language in such a critical place.)