Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,439 of 33,346    |
|    DeMarcus to All    |
|    Re: Will we ever be able to throw from a    |
|    01 Jul 12 15:03:44    |
      From: use_my_alias_here@hotmail.com              > It's not likely that any code will look for and catch out-of-bounds       > exceptions, since they usually represent programming errors, and       > nobody can maintain his sanity while coding as though the program is       > broken.       >              Imagine that a corrupt configure file (e.g. XML) generates the out-of-bounds       exception, then it's not a programming error but rather a corrupt or invalid       file.                     >> That is what I meant with bulking. Somehow, you must be able to deal       >> with /multiple/ exception chains. Just putting a completely       >> independent secondary exception in the same chain as the active       >> exception chain will, in best case, lead to that the secondary       >> exception is missed and lost.       >       > There's no loss; the chains I'm talking about can be walked and       > inspected by exception handling code.       >              I try to emphasize the same problem that Wil Evers does when he discusses the       alternatives for a handler; (1) terminate, (2) propagate and ignore secondary,       (3) link.              I'm out of good examples to illustrate the problem but one use case I will       investigate myself is the following.              1. Create two RAII objects A and B, that with 50% chance each throw from the       destructor. B throws BException and A throws AException.       2. Write a consistent exception handling that prints AException to std::cout       and retries B until it succeeds.                     >> Allowing secondary exceptions may lead to something better, but I       >> think there must be some recommendations and guidelines how to use       >> it.       >       > Of course there must be guidelines. You just don't seem to agree that       > one reasonable guideline is "just ignore that one."       >              Definitely not. Just ignoring an exception is not an option to me unless the       software requirement allows it.                     Regards,       Daniel                     --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca