Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to handle all errors, including internal C library errors, uniformly
    primarykey
    data
    text
    <p>I wanted to handle all internal errors gracefully, without program termination.</p> <p>As discussed <a href="http://msdn.microsoft.com/en-us/library/ms680634(VS.85).aspx" rel="nofollow noreferrer">here</a>, using <strong>_set_se_translator</strong> catches divide-by-zero errors. </p> <p>But it does not catch, for example, C runtime library error <em>-1073740777 (0xc0000417)</em>, which can be caused by format strings for <strong>printf</strong> which have the percent sign where they shouldn't. (That is just an example; of course we should check for such strings). To handle these, <strong>_set_invalid_parameter_handler</strong> is needed. </p> <p>There are about ten other such handlers listed <a href="https://stackoverflow.com/questions/82483/how-to-catch-all-exceptions-crashes-in-a-net-app">here</a>.</p> <p>In addition, this one will catch uncaught C++ exceptions: <a href="http://msdn.microsoft.com/en-us/library/ms680634(VS.85).aspx" rel="nofollow noreferrer"><strong>SetUnhandledExceptionFilter</strong></a>. Thus, it can be used together with the <strong>__set__ ...</strong> functions. (An article about <a href="http://blog.kalmbachnet.de/?postid=75" rel="nofollow noreferrer">using it</a> in MSVC 2008.)</p> <p>I want to catch any and all errors so I can handle them (by logging, throwing a modern C++ standard exception and returning an application-specific error code). Is there a single handler that catches everything? </p> <p>See also this on <a href="https://stackoverflow.com/questions/82483/how-to-catch-all-exceptions-crashes-in-a-net-app">StackOverflow</a>.</p> <p>I am using Visual Studio 2008.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload