
Ames Andreas wrote:
If you forget to handle a relevant exception in HandleException, is your debugger able to show you the 'right' backtrace (i.e. where the exception really occurred)? I don't think the op's idea has that problem.
Really? I don't see how the OPs code is any different in this regard. To quote the OP: <OP>
try { //Some code that might throw exceptions, such as: throw std::logic_error("A sample logic error."); } catch(...) { //Magic happens here. catcher(my_exception_handler()); //This prints out "my_exception_handler::operator()(std::logic_error&)" } </OP>
How does catcher find out what exception was thrown? It seems it must use the same idiom that ::HandleException() uses, i.e. throw; inside a try block. Once you do that, most debuggers won't be able to show the original stack trace. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.