Shawn Weisfeld

I find when I talk to myself nobody listens. - Shawn Weisfeld
posts - 356, comments - 173, trackbacks - 34

My Links

News

The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.

Archives

Post Categories

What do your error messages reveal?

I know that most of you all know this already, but I figured it was worth a blog post since I just saw this from http://www.autosite.com. I got this very informative error message back when using their site earlier. . .

Query Of Queries runtime error.
Expected type STRING but encountered type NULL on the left of the LIKE condition 
The error occurred in D:\INETPUB\wwwroot\content\Research\kbb\act_valueReport.cfm: line 74
Called from D:\INETPUB\WWWROOT\content\Research\kbb\index.cfm: line 21
72 :
73 :  <cfmodule template="mod_kbbtable.cfm" width="#kbbModTableWidth#">
74 :  <cfquery dbtype="query" name="qEquip">
75 :  SELECT * FROM valueReport.Equipments WHERE GroupCode LIKE 'M' ORDER BY DisplayOrder
76 :  </cfquery>

While it is important for us as developers to log this type of information, there is NO reason for us to show it to our customers. Now I know table names, physical paths, and other good stuff. In your asp.net applicaitons make sure you set your customer errors to “On” (http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx). You also want to make sure that you have logging so that you as the developer can triage errors.

Oh and here is a BONUS TIP: Don’t use Select *, in most cases you don’t need all the columns and there is no reason to have the DB send them all back. . . .

Let’s start a campaign to call out any website that we see on the internet that doesn’t properly hide their dirty laundry.

Print | posted on Monday, March 09, 2009 12:46 PM | Filed Under [ .NET ASP.NET C# SQL VB.NET ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 2 and 6 and type the answer here:

Powered by: