Beware of IE’s Friendly Error Messages

December 28, 2005

I’m right in the middle of a fairly significant enhancement to a project at work. The enhancement itself is not that difficult on paper however it involves a large amount of code refactoring to get things situated appropriately.

After spending a couple hours combining two projects and merging the object models, I started trying to test the most basic web service functionality of the project. Of course, it failed with a “HTTP 500 - Internal server error ” message. It wasn’t unexpected and I assumed it was the actual calls to our backend. Surprisingly, further testing revealed everything was working all the way to the backend and up until the end of the web service call. I added a try…catch block hoping to catch it. No dice. Since it made it to the end, I thought it might be a serialization issue. I went back through the code and found a couple of entities not marked “Serializable” which I thought might be causing the problem. Ran the test again. Same thing. More digging, more tweaking, more testing. No luck.

In a normal debugging situation, I would immediately turn to Google to see what I could turn up. However in this case, all I had was the “HTTP 500 - Internal server error ” message which is pretty generic and I didn’t think it would do me any good. So, after over an hour of struggling, I caved and decided to see if the Google gods would have mercy on me. A couple queries later and I’m looking at Xml Soap Exceptions - Get Internal 500 Error. Hmmm. The poster was having a similar issue to mine. The only response was from the original poster: “Duh, got it, need to uncheck Friendly Error Message in IE.”

Gosh, why would I need to uncheck that? After all, the error is being generated on the server and the browser is just displaying the HTML returned from the server. Right? Since I had nothing else to go on and had actually never heard of the “Friendly Error Message” option, I decided to check it out. Sure enough, on the Advanced tab, under the Browsing section, there is a checkbox for “Show friendly HTTP error messages.” And what do you know? I re-ran my test and got the following helpful error message: “There was an error generating the XML document. –> The type Some.Entity.Specific.To.My.Day.Job was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.”

Now, I’m not usually a Microsoft or Internet Explorer basher, but who the hell decided that this would be a good option? If this were an obscure problem on a public site and a customer called reporting that they were getting a “HTTP 500 - Internal server error” message, who knows how hard it would have been to solve. Certainly not as easy as it would have been if they were able to report the specific error message.

I guess it’s my fault though. I should have known about the Friendly Error Messages option. After all, a couple of years ago, I got burned by the “Display a notification about every script error” option. If that isn’t checked, not only do you not get the pop-up telling you there was a script error on the page, but it also doesn’t even change the icon in the bottom-left by the status bar. You kind of need that when you are coding JavaScript. That one cost me a couple hours then too. I wonder what other wonderful settings there are to make my life more miserable.

FYI, Firefox displayed the actual error message as well without changing any settings. That’ll teach me to stray!

Popularity: 4% [?]

Comments

Got something to say?





MyHomePoint

Having trouble keeping track of everything going on at home? Is the refrigerator organizer not cutting it anymore? We feel the same way...
Check out MyHomePoint »

Close
E-mail It