23 Feb 2005
|
Printable version | Email to a friend |
| IE's "friendly" error messages | |
|
|
|
|
While hacking URLs at www.sonyericsson.com to make it possible to be automatically informed when a new firmware is released for my P900 by using the excellent free service WatchThatPage to monitor the URL that I had hacked together (no thanks to the abominally unfriendly URL scheme used by their CMS), I came across the following message hidden in a comment in a redirector page:
Unfortunately, Microsoft has added a clever new "feature" to Internet Explorer. If the text in an error's message is "too small", specifically less than 512 bytes, Internet Explorer returns its own error message. Yes, you can turn that off, but *surprise* it's pretty tricky to find buried as a switch called "smart error messages" That means, of course, that many of Resin's error messages are censored by default. And, of course, you'll be shocked to learn that IIS always returns error messages that are long enough to make Internet Explorer happy. The workaround is pretty simple: pad the error message with a big comment to push it over the five hundred and twelve byte minimum. Of course, that's exactly what you're reading right now.NOTE: So, it would appear that 512 is the magic number of bytes required to force IE to display your error message instead of your own. Personally I think it's is damn stupid of IE to attempt to intercept an error and display its own error message instead of the server's, and such a feature certainly shouldn't be on by default. It's impossible to fathom the total loss of productivity that this single implementation "feature" has caused to puzzled developers across the world, but here's proof (if proof be needed) that it is a recurrent problem. It's a matter of habit that I always switch off "Show friendly HTTP error messages" (the correct name for the switch mentioned in the above text), and "Show friendly URLs" in the preferences section of Internet Explorer, since I find them irritating and they often interfere with debugging web apps during development. But clearly one should take precautions (as described in the quoted text above) to ensure that IE doesn't interfere with error messages displayed to end users. Another thumbs-down to MS for that not-so-bright idea. Incidentally, I also switch on "Display a notification about every script error", which is one of the main reasons why there's so much bad JavaScript floating around - developers who don't switch this on aren't told about errors in their code. Naturally, this also causes huge headaches during development for those who aren't aware of this. |
|
| development , rant | |
|
|
|
| posted by Marcus at 12:28 | comments [3] | trackbacks [69] | |
|
|
| posted by rick hurst [ http://hypothecate.co.uk ] | 23 Feb 2005 at 13:43 |
Resin is in fact a JSP/ Servlet engine :-) http://www.caucho.com/resin/ |
|
| posted by Nick Fitzsimons [ http://www.nickfitz.co.uk/ ] | 5 Apr 2005 at 13:38 |
"Display a notification about every script error", .. is one of the main reasons why there's so much bad JavaScript floating around I've even encountered web app code which seemed to work OK until the error notification was enabled. I never had time to work out what was going on (it was quicker to rewrite from scratch than try to unravel the spaghetti), but it seemed to be something to do with an error in an iframe causing the calling code to terminate if the error notification was enabled, but allowing the calling code to continue otherwise. When I did have time to investigate, judicious googling allowed me to identify client and ASP code from four separate tutorial or open source sites which had been cobbled together to form a CMS. Naturally the developer hadn't told his emplyer where the code came from; they thought he must be brilliant, getting something like that working.. then I enabled script error notification on their machines :-) |
|

