Lurker News

Comments (122) 57 threads

Show all comments

Showing thread 2 of 57

self_awareness5 replies#
It hangs on "reading stories".

Web app authors can be very creative, but one thing I don't like about web apps is that often their error handling is nonexistent. It's not about individual authors; behemots like Microsoft also do this in an irritating way: "Something did not work. Reload the page please" -- Is this really the best a billion dollar company can do? Well, I suppose this is still better than no error at all, which is a default error handling method for big chunk of web apps.
I think (but can be wrong) that by using such a dynamic environment like JS is the culprit for lack of good error checking mechanism.
Also one thought of mine for the reason why even big companies are unwilling to provide good error messages is that it's impossible to get the real reason. There may be so many moving parts that even the developer isn't able to handle it all. Which sparks a doubt in my mind if this environment is really fit enough to provide high quality software. Since it's so popular it's obvious that it has some aspects that it does right, but it seems that the web app environment could benefit from some fundamental changes.

thesephist3 replies#
It actually does handle errors properly -- the reddit api is probably blocked for you, which is why it hangs and can't do anything. I suppose I could have added a "it seems we can't reach Reddit" kind of message, but that would still have been an error state, and in rushing this out in an afternoon it wasn't much of a priority.

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.

thih9#
> It actually does handle errors properly

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.

StrangeSound1 reply#
It doesn't load for me in Chrome either.

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

thesephist1 reply#
Darn, can't believe I didn't catch that typo until now. I don't think that was the issue -- unbound variables don't cause exceptions in JS until that variable is dereferenced -- but not sure what else it could be if the reddit api hit is succeeding with a 200. Maybe a wonky JSON Decode?
eitland#
> Darn, can't believe I didn't catch that typo until now. I don't think that was the issue -- unbound variables don't cause exceptions in JS until that variable is dereferenced

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.)

jfkebwjsbx#
Hanging or crashing without feedback is pretty much "not handling errors".
bartread#
> I think (but can be wrong) that by using such a dynamic environment like JS is the culprit for lack of good error checking mechanism.

Not at all. It's perfectly possible to implement solid error handling. There's even a global handler: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEvent....
For legacy scenarios (IE11) you can add an event handler for the error event, so you end up with something like the following to deal with both situations:

    window.onerror = yourErrorHandlerFunction;
    window.addEventListener('error', yourErrorEventHandlerFunction);
The shape of the objects passed in differs slightly, hence the need for two different handlers. In my case one simply repackages the object and hands it off to the other.
bonoboTP2 replies#
They (MS etc) know the error alright, but users get scared and overwhelmed by technical language and error messages. So they put some picture of a sad cat and a message like "zoinks, that didn't work, try again". And anyway, if you're going to reload anyway, why would you care about the exact error? Hopefully it got logged in their systems so the engineers can come back to it. Beyond nerd curiosity, why would a user need non-actionable detailed error messages?
ape41 reply#
How about the diagnostic tool you can launch in Windows. It works away for 5 minutes then says it couldn't fix it.
bentcorner#
Are you talking about the Windows Error Reporting tool? It can occasionally work (I was notified once that a crashing driver had an update to fix the crash I ran into). Most of the time the crash/hang data is used to prioritize fixes in a later release.
self_awareness#
the problem is that most of the time I'm reloading the page and exact same error appears. With more details I could troubleshoot the problem, but with errors like that I'm just closing the tab/windows app and I'm starting writing rants about it on the internet :D
davidajackson#
Microsoft also often includes a long id for the error and shows it to the user in for example Office 365, which is mostly useless to the user (they could compress it into a nice shorter id).
vmception#
Everything you wrote is wrong and you've clearly been trying to support that pre-existing conclusion for years.

It has an error. Report the bug. Hope it gets fixed. The end.