What errors / exceptions trigger Windows error reporting?

When running a Delphi application outside the debugger, most of the exceptions that are thrown appear to be silently ignored (for example, an access violation). Occasionally, however, the Windows Error Reporting dialog box appears (submit or not submit, you probably know what I mean). What exactly does this mean? What errors trigger this behavior?

Additional information: I have a global exception handler for my application that should log all unhandled exceptions. This way, no exceptions should leave the application unhandled.

Thank.

+2


source to share


4 answers


Most exceptions are not ignored when run outside the debugger. They are usually captured by the event loop in VCL applications, or hit the main start / end in console applications, etc. By default, the VCL event loop aciton displays a dialog box containing the message associated with the exception.



If the exception escapes from the application, either by reaching the main start / end without being caught or caught by the event loop that Windows error reporting steps are functional, this is an exception handler just like any other except the stack base itself.

+3


source


It covers exceptions that are not handled by the application - if the exception is propagated outside of the application's main entry point, then WER will enter. This covers things like AV, division by zero, invalid handle access, and other group or "chip" exceptions. Sometimes your code might try to handle these things, but if the memory is damaged too much or what you have, then your code will die.



+2


source


Problems usually arise if you have exceptions in threads that are not handled in a method Execute

. The program will mostly be killed, but the behavior is unpredictable and seems to depend on many things (like the number and state of other threads). Often the main window will disappear immediately and no subsequent exceptions will thus be handled by the program, which is probably why WER can catch them.

I'm used to having an external exception handler in Execute

, which logs any unhandled exceptions and allows the thread to finish cleanly.

+2


source


Exceptions thrown in the initialization and completion sections can hide your global exception handler and cause WER.

+1


source







All Articles