Test Case 32: Verify that the application’s UI thread only handles exceptions that are known and expected (Req:3.2)

This test case expects an application handle known exceptions only and leaves generic exception for Windows. You do not need to write any additional code to satisfy this test case in Vista. Actually, one should not write any code to catch generic exceptions. Even if you catch generic exception throw the exception again for the Vista to grab and activate Windows Error Reporting (WER).

Question: What is the exact WER message? Is display of this box (just “Close program”), sufficient to pass TC32?

Answer:

clip_image001 

Figure 1: WER Send message

The above is a standard WER message shown in Vista. However, the exact message window may vary depending on a few situations. For WER when an error report is created it can be in one of two states:

  1. Extra data is needed for analysis on the server
  2. No more data is needed for this bucket on the server

clip_image002

Figure 2: WER message with Close

Depending upon the WER setting in the system and the situation above the WER messages can be as follows.

  1. "Do you want to send more information about the problem? Additional details about what went wrong can help Microsoft create a solution.", with TWO buttons, "Send Information", "Cancel".  (Figure 1) 
  2. "MyTest has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available", with a button "Close program".   (Figure 2) 

The above may vary little bit, depending upon WER setting in Control Panel, however, Dialog 2 always comes with Send Information and the Dialog 1 does not have it.

However, for a valid WER to complete, there must be two error messages one with “Source” listed as Application Error and another Information message with “Source” listed as Windows Error Reporting are logged in the event viewer whenever an error occurs.

 

Question: If the user is least privileged user, there is only "Application Error" in the Windows Event Log.

Answer: All crashes (WER) get cued and can only be viewed as an Administrator.  If you open the Event View Snap-in as an admin, these events should be cued and should be able to be seen. 

The last thing one can do is to log onto the machine as an Administrator, inject the failure and in the Control Panel | System Maintenance | Problems and Solutions |View Problem History.

If you see Report Sent and still do not see the event in the event viewer, log-off/log-on. Event should then have finished the cue process and appear.

 

Question: I have a .NET 1.1 application and I’m getting a CLR message, not the WER message.

Answer: WER doesn’t work in .NET 1.1 applications properly. So for future compatibility, recommendation is to make your application upgrade to .NET 2.0.

 

Further resources on WER

Windows Error Reporting and the Problem Reports and Solutions Feature in Windows Vista

What's New in WER