Putting SxS errors in your face

Published 01 May 07 09:18 AM | john 

There are two schools of thought when it comes to unrecoverable software errors.  One say that errors should be in your face and the other says that errors should be hidden (or at least smoothed over).  It's not hard to see that the latter is a good approach for non-technical computer users.  Your parents don't care that your application has thrown a "NullReferenceException".  They are most likely going to cycle the power on the computer to solve the problem.  You on the other hand as a technically savvy computer user should prefer the former approach.  Hidden errors give you absolutely no indication of what is going wrong with your software, and thus you have no clues about how to go about fixing any problem.

SxS errors, although critical, take the "lets not tell the user" approach. This is heinous.  Recently though, one of my clever co-workers came up with a cool trick to put those SxS errors "in your face" so that you can go about fixing them.  The trick is simple.  SxS errors are logged to the System event log.  All you do is set up a scheduled task that triggers off of a particular message in the event log and throws up a message box!  Here's how to do it on non-Vista machines (2003/XP).  At a command prompt, type:

eventtriggers /create /tr SxSWarn /RU "" /l System /eid 32 /d "Warns user when a SxS error occurs." /tk "msg %USERNAME% SxS error detected, please check System event log."

On Vista, type:

schtasks /create /TN SxSWarn /SC ONEVENT /EC Application /MO *[System/Level=2][System[Provider[@Name='SideBySide']]] /TR "msg %USERNAME% SxS error detected, please check the Application event log."

 

Filed under: , , , , ,

Comments

# The Director of Random Technologies said on July 23, 2007 4:01 PM:

While I haven't been posting much here, I have been posting pretty regularly over on my main development

# Noticias externas said on July 23, 2007 5:02 PM:

While I haven't been posting much here, I have been posting pretty regularly over on my main development

Anonymous comments are disabled