Boost logo

Boost :

From: Andreas Huber (ahd6974-spamgroupstrap_at_[hidden])
Date: 2006-07-19 14:04:20

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:

> 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&)"
> }

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.


Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

Boost list run by bdawes at, gregod at, cpdaniel at, john at