142 points · by pabs3 · 3y ago · 207 comments
I'm old enough to remember times before browsers showed 'friendly' error messages, and a 500 response from a server would display a '500 Server Error' message to the user. Users hated it. They'd panic and think they'd broken the website somehow. It was horrible from a support perspective, and if the user was new to the web it sometimes made them very anxious about using the web in the future.
Users have no business seeing error codes. Those are for devs. Hiding them away in devtools is a very good thing.
I think the change was very simple - we stopped bothering with middleground. "Power Users" were treated like "users, but a bit more", so we had 'users', 'power users', and 'developers'. All that happened is that we just accepted that power user can have the same access to tools as developers.
We didn't stop giving power users extra power. We gave power users more power.
No, most software today is designed for the use case that you have never seen the software before. That is implicitly enforced by the way most companies do A/B testing. The experiments show a new part of the UI to an unsuspecting user without any upfront knowledge that they are part of an experiment. Therefore the variant that has the lowest hurdle for the most common case of the most common user is optimized. So it is basically ignored that people tend to learn how to use their tools.
Learning to learn your tools is even made harder by constantly changing UIs. Reading documentation, following tutorial, watching introduction videos is basically useless for a software that will change whenever a product manager needs to complete an increment for his KPIs.
I don't think we did. The trend in the past few years is to dumb down all tools, especially UI tools, to the lowest common denominator.
I was trying to place an order, and it kept failing with a red banner stating "something went wrong" (I'm paraphrasing as I don't recall the exact verbage, but it was one of those completely worthless error messages)
Pop open dev tools ... the server is returning something about a graphql error.
Support had no idea what was wrong.
The problem ended up being that my saved credit card had expired. For fuck's sake, that is a user-actionable error; tell me what the problem is. At least tell me it was a payment problem, since that's probably all the payment processor told you.
Opinion: I quite like the scroll, I think it comforting to see what the machine is doing. I think this is why sim city put a fake one in their loader(reticulating splines anyone). I wonder if the sim city messages tied into actual load events and could be used by the programmers to debug the loader. I think the later ones were random, but 2000 might of had an order to it.
The individual subsystems should be able to recognize their correct state and output a clear diagnostic when they are not in that state. I shouldn't have to step back through e.g. several broken services to find out my second ethernet port didn't initialize.
In other words, as a power user, I want to know if the site has a "You problem", and the only explanation I fully accept for why the modern web doesn't notify users about website errors is that it allows companies to save on QA costs.
I think we just have fight for poweruser options to be available via APIs and support the add-on ecosystem.
That's completely wrong.
1xx codes are all INFORMATIONAL (usually used for switching protocols).
2xx codes are all SUCCESS.
3xx codes are all REDIRECTs.
4xx codes are all CLIENT ERROR.
Only 5xx codes are SERVER ERROR.
1996 or 1997. I can't narrow it down further.
Shortly after that, they actively became hostile to power users. Just play with your dumb little consumer appliance like you're supposed to.
At second; it would likely mean many folks lacking in other skills, unbalancing what little we have in the society of work.
At third: include all the error detail you like, simply put it behind a "click here for more details" side door.
What?
The moment they(i mean we) started blocking ads I think.
I drive a car and only care about the speed, how far I can drive and to be warned that I have to stop if something is wrong.
I do not care about the temperature of the oil or water, about the tension on the thffr which powers the louhguh or why zgfnkvgv failed.
I know that if something goes wrong I will call the road assistance number.
If someone wants to learn more there is the hidden bus they can plug into, aka Dev Tools For Cars
It's not a big deal for a power user to hit F12 then click the network tab...
That’s pretty power user friendly.
I can't say I agree. That would be a good idea in a world where users never encountered errors in normal circumstances, but in fact computers don't work very well and users encounter errors on a regular basis. Using computers is a skill. It takes study. You can either pretend that it doesn't, giving users something underpowered that is going to break anyway, or acknowledge that computers are complicated, and build tools and resources to help users navigate them. And users should recognize it as folly to try to use the most complicated tools on the planet today without any understanding of how they work.
This doesn't really apply to HTTP status codes. They're largely useless. It does apply to the way my Macintosh told me of a misconfiguration after I reinstalled the operating system. Somehow the people at Apple thought an error code and a brief description would be scary, so they opted for this absolutely terrifying icon instead:
https://i.stack.imgur.com/Y1teY.jpg
(Not my picture, by the way.)
I think what's been lost -- or perhaps never been gained -- is an art of dual tiering error condition messaging.
Highest visibility messaging should be the simple & for the most general audience: "You Gave us Bad Information, here's how to fix it" for cases where that applies, with more information available for training users if they want it.
When it's an application or systems failure: "Something went wrong on our end, not your fault" should be the high visibility message. Then maybe "here's a request ID, you can contact this support channel about it if the problem persists". Then somewhere low visibility "here's some detail about what's going on under the hood if you want to look."
This is part of a general sin in product / UX as far as I can tell: the "don't make me think" mantra became something itself people stopped thinking about and transformed effectively into "don't LET me think."
That error is the boot firmware telling you it can’t find a bootable OS. It doesn’t know what language you speak, and would an error code really be helpful? If you’re knowledgeable enough to know what the error codes mean, you would know that cmd-V gives you verbose logging.
This is exactly the sort of thing I'm talking about. You assume that anyone who doesn't know every hidden Macintosh hotkey is so ignorant of computers they won't even know how to look up an error code. If there are magic hotkeys that modify the boot sequence, that might be some information I would like to know when trying to boot my computer! Why not display those hotkeys during the boot sequence like a normal OS?
Edit: Is the blue screen of death still a thing these days? I haven't actually used Windows in a decade.
This is why interfaces made by programmers tend to be impossible to use. Our minds simply work differently than normal people. In the 99% case, that icon will tell a user precisely the same information as any kind of detailed error log, which is "Oh no, something is broken, I should go to the Apple store."
I sometimes hear the "best of both worlds" is something like logging all errors while showing optimistic errors to the users on frontend. This is somewhat fine for errors that happen on the backend, but catching browser errors is tricky because extensions can throw errors. On top of that a user might not be comfortable with you collecting errors that happen in their browser.
I don't know that there's a lot of useful middle ground between your two examples though. By definition, a UI can't really give actionable advice on how to fix an error that it isn't programmed to expect.
It was a bit of a rhetorical statement (or at least in my mind it was). Like how about "Something went wrong (see details)" or something to that effect?
In my work experience some people are really dogmatic about the idea of not showing any sort of error messages to users whatsoever.
"TypeError: Cannot read property 'submit' of null" is cheap (just render whatever error you get).
Anything else is expensive, and probably doesn't gain you anything.
The user probably can't do anything about a null reference, so there's not a lot of benefit in providing this level of detail, and for most users it obscures the bigger point that "something went wrong."
This is an Anti-pattern called mushroom management (keeping users in the dark).
Not telling users what went wrong is just plain wrong. Breaking the termomether to hide fever.
When you get an error message you can at least google it, or make a ticket.
Then again, I also think people should be taught better than to hop on the Web without any training or knowledge. Computers and illiteracy go together about as well as books go with illiteracy. It takes effort to be computer literate, and hiding the information will make that journey to literacy more daunting than it needs to be.
* Which for me has almost always just meant some oil change "timer" was up, not even that any meter detected my oil was wearing out.
1. the attacker can see (but not decrypt) the victim's TLS traffic to example.com
2. an attacker-controlled website makes the victim send many different invalid requests to example.com, each of which gets an error message
3. some data in each request is attacker-controlled, but authentication data in headers is filled in by the victim's browser
4. example.com compresses response data before encrypting it
5. because repetitions affect compression, the response size is smallest when the authentication data matches part of the attacker-controlled data
6. after enough requests, the attacker knows the authentication data to login to example.com as the victim
One workaround for CVE-2012-4929 was to set up the server so that an error message never depended on the request data. Before CVE-2012-4929 was announced, people thought it was sufficient to sanitize the error message (i.e., avoid XSS) but CVE-2012-4929 prompted a shift toward producing exactly the same error message for all invalid requests. (Not sure, but I think this was the original motivation for Google's famous "That's an error. That's all we know." messages.)
There were better CVE-2012-4929 defenses later, but the cargo cult had already formed. (Some subset of) a generation of developers believed that customized error messages were Very Bad because they enabled account takeover.
This is an opinion that, on a personal preference level, I share. It's not, however, a universal truth. An optimally useful computer should be a human interface to information or control of something. The best computer is one that interprets a messy human command, produces the information or action that the human actually wanted, and requires no training at all to use.
Such a machine would be anathema to me, personally, but it would be objectively the best possible general purpose computing device.
So in a way, they are already "elaborating" the type of error - as well as a single 32-bit integer in C can "elaborate" over an error, that is, not a lot.
For all their faults dotnet and java make it really easy to not mangle up the stack trace.
[0] https://www.microsoft.com/download/details.aspx?id=100432
Something happened
Ah, yes, I love remote troubleshooting.
"What does the site says?"
"Hell I know but there are funny badgers singing about mushrooms!"
More so, problem maybe somewhere else so S. wouldn't even help here
javascript:(function()%7Bjavascript%3A(function()%20%7B%0A%20%20var%20xhr%20%3D%20new%20XMLHttpRequest()%3B%0A%20%20xhr.onreadystatechange%20%3D%20function()%20%7B%0A%20%20%20%20if%20(xhr.readyState%20%3D%3D%3D%204)%20%7B%0A%20%20%20%20%20%20alert('HTTP%20Status%20Code%3A%20'%20%2B%20xhr.status)%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%20%20xhr.open('GET'%2C%20window.location.href%2C%20true)%3B%0A%20%20xhr.send()%3B%0A%7D)()%3B%7D)()%3B javascript:(function(){javascript:(function() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
alert('HTTP Status Code: ' + xhr.status);
}
};
xhr.open('GET', window.location.href, true);
xhr.send();
})();})();People like you are the reason users cannot work a file system, download an image, or even read a short text message. You retard the users' progress.
Once you have this realization, what's the advantage of showing the proper error code to the user? Whatever it is, it's not in his power to fix it
While code fixes are not in their power to do, changing their behavior, or waiting for a better internet connection (i.e. "something went wrong" actually means "go log in to the hotel wifi") are things in their power.
Have you ever done end user support? Having a moderate amount of detail like an HTTP response code saves tons of time and headaches when a user calls in.
And some of the specific codes you mentioned (401, 403, and 429 for example) actually do give a power user actionable information. They can know that there's something wrong with their login credentials or permissions, or that they are making too many requests too quickly and need to slow down or wait to stop being rate limited. And knowing that it's some kind of 500 error lets a power user know "Ok, this probably isn't an issue on my end" which helps them stop worrying that it's something they're doing wrong or something wrong with their system.
I draw the line at nice urls though, I think that's valuable to the client app and the user. At the very least, bookmarks work. Even with all the other state than can exist, it's a solid and useful reference point.
A good web server validates the user input, throws a 4xx error if the input is bad for the current state, and if something still goes wrong (which is a server bug) the 5xx range becomes appropriate.
Or much more importantly, errors incorrectly returned with 200/OK success codes are cached, semi-permanently breaking your site.
If you've get helpdesk staff telling customers to "clear their browser cache", this is one common reason why this "works" as a fix.
Please, I beg you: stop being "nice". Stop catching exceptions and dropping them on the floor! Let them bubble up to the web framework pipeline so that an error code is sent.
Your CDN will thank you. Browser caches will thank you. Corporate proxy servers will thank you. Application monitoring tools will thank you. Load balancers will thank you.
I kid, I kid. None of those will send you thanks in an email. Instead, they'll work tirelessly in silence to deliver your application as intended, instead of holding on to transient errors for days on end and upsetting your users.
Most developers I notice just catch the error right away and make the function return something non-sensible like a 0 for a string value function.
Slightly better developers just let the exceptions bubble.
The rare breed looks at what exceptions are being thrown, decides which ones to handle at which stack level, and repackages them as needed when the error cannot be handled that deep in that stack due to a lack of context. Then they write framework-level exception handlers for errors that rise to the top because they cannot be corrected at a higher stack level to give users specific error messages with user-correctable actions without revealing anything sensitive. “Your image is too small, wanker.”
On Error Resume Next
In the first line of every function. It's tells the Interpreter:
"Shhhh, it's fine. Just ignore errors. Division by zero? No worries. It's Fiiiiine. Try to access inexistent index of an array? Who cares, it's Friday!"
catch {};The exception needs to bubble up to the request pipeline, which will set an integer error code, and then... redirect to a generic "sorry we broke" error page.
Showing the full exception stack trace and other sensitive bits and pieces is for local debug mode, not for production.
Normal users would never notice and could browse the site fine - but bots (and particularly vulnerability scanning tools) couldn't cope with it and would show all kinds of weird results and false positives/negatives.
And you run the risk of having a transparent proxy fail on your real users doing this too. It's why nobody does it.
Casual bots is what 95% of website operators have to deal with, blocking them is still a win.
Same reason people move ssh ports around. Of course it doesn't add security if you're targeted, but it makes casual bruteforce bots go away.
Call that log hygiene if you really object to the security aspect.
Chris says that the loading of sub-resources is a different matter. Well, the most common silent failure I have is not due to status codes per se, but because of my DNS-based adblocker, many sub-resources fail to load (GET or POST) with a network error (TCP RST). Unless a blocked domain corresponds to the front page I visit in a URL, the unavailable resource represents a silent failure, and I have foolishly contacted Support desks multiple times because my own use of the adblocker caused a silent failure that was difficult to diagnose.
In fact, I now have no way of knowing what web apps are like without an adblocker. Because all my devices use the same configuration, and it's non-trivial to disable it, I simply don't know what I am missing. Indeed, in the case of one web app which I've used as a PWA, it was simply missing features that I knew should have been there, and whitelisting enough domain names caused those features to re-appear.
I will just leave you with the most adorable 404 page anyone has ever seen: https://diopitt.org/pray/amen
In the context of your comment, I was amused by how my own ad-blocker failed to properly show the (image on the) 404 page, since it is loaded from a different domain :D
See also Richard I. Cook's "How Complex Systems Fail": <https://how.complexsystems.fail/>
(Latter is an HN perennial, with 55 sumbissions presently: <https://hn.algolia.com/?q=how%20complex%20systems%20fail>. Most recent 10 months ago, so not quite ready for a re-up: <https://news.ycombinator.com/item?id=32895812>.)
The Internet Archive has a copy as well: <https://web.archive.org/web/20200922230737/https://deirdre.n...>
This is exactly why I do not use a DNS-based ad blocking solution (it’s trivial to disable uBlock Origin and refresh if something feels broken).
In what way? Do you mean not feasible or just lazily coded?
Is this not intended behavior? Were you not expecting ads to be silently removed?
But unless you open the dev tools' network tab, you don't know about that request failing.
My ad blocker returns "0.0.0.0" for A records, which in practice means attempts to connect to 127.0.0.1, which isn't running a server of any kind on port 443/tcp or 80/tcp. So a standards-compliant client would really hang awhile, or hold rendering, until several connects have been attempted and they all failed.
They have a feature where if you're a free user, and you exceed your query quota for the month, they turn off all features and it acts like a normal resolver.
For some reason, there is no access to such a setting to do it manually, and I am a subscriber now, too.
There are profiles that can be configured separately, but even just to activate an alternate profile, one must reconfigure the DNS settings on the devices.
pihole as cache, with the router as its upstream, with NextDNS as the router's dns server
It's preferable to not make additional requests (like for an image) on an error page - in case the requested server is at fault - breaking the error page.
<link id="favicon" rel="icon" type="image/svg+xml" href="data:image/svg+xml,
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1'>
<rect width='1' height='1' fill='DodgerBlue' />
</svg>"
>
What's nice is that this opens up the possibility to generate dynamic favicons really easily using only string interpolation.And if the server has broken so badly it can't send out that image, then I have much bigger worries than an ugly 404 page.
And then Oracle shipped the AskBar into the Java installers.
https://stackoverflow.com/questions/8338427/i-created-a-cust...
Failures fall into two often very distinct cases:
1. Failures the end-user is able to understand and in some circumstandes to fix themselves. Examples: (HTML) page not found, no connection, etc.
2. Failures the end-user is in no case able to fix; it's up to the programmer. Examples: Server misconfigured, missing media files on server, etc.
It never makes sense to display the full error messages in case 2. It suffices to hide the error and perhaps make it available in DevTools. Often a good way is: give a generic message, and because some failures are transient, tell the user to retry. Also it can make sense to add an error number so that the end-user can give support the error number.
So it is useful to let the browser be lenient with HTTP status codes except in some specific cases which the article does mention (HTTP status code 500 for JavaScript files, for example).
Custom 404 pages to give the user a friendly explaination and further directions, 500 pages with the exception stack trace in our frameworks to debug the errors etc.
A status different from 200 rarely means there's nothing that could be displayed to the user.
A malicious server can just as easily send the wrong status code, as well as listing the wrong status code in the accompanying html - so if the browser did show the real status code more prominently to the user, that wouldn't actually help in such a case, or would it?
Every once in a while they remove widely used functionality from the UI or bury it behind a lot of other crap, so someone has to invent an extension to bring it back. It's terrible.
All the alternatives have varying degrees of suckitude, and there's no way to just make an alternative browser without like $1.5 million dollars and two years of development.
Web browsers handle the status code correctly by displaying the error in the response body. 500 isn't for end users - it is for web crawlers and caching proxies.
500 / 503 seems to fit any and every error these days, or the classic 200 OK for a page not found.
The days of a bespectacled web user, thoughtfully musing over an error message, while fiddling with a self-propelling pencil, sat at a Sun/SGI/HP/IBM X11 session are long gone.
Having said that, if the status code is in the 4xx client error range, I'd wish that any document.title would be strictly ignored and browsers would always display the status code (together with the human readable error title) as the page title.
That was a mistake.
Chrome outright refuses to show the HTML of a 500 response in favor of its own dinosaur animation or some garbage, or did that change?
Boy the reports that my browser “wasn’t ready for prime-time” as a result…
It now only shows if the domain can’t be resolved, people are happy