I get an error on my unit test and it hangs my TeamCity continuous integration. How can I make it error headlessly? Fixing the error is a separate issue, please don’t tell me that.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest solution is very likely to use
SetErrorMode(with – at least –SEM_NOGPFAULTERRORBOX) to shut up any such error dialogs (see the flags in the MSDN docs) and silently have the process terminated.Another option is to install your own top-level exception handler. In XP and newer you can use vectored exception handling. On any system including those newer ones you can use
SetUnhandledExceptionFilter.Part V, particularly chapter 25, of “Windows via C++” by Richter and Nasarre discusses the topic at great length and detail. The particular topic of WER and top-level exception handlers is also discussed in “Advanced Windows Debugging” (though from a different perspective).