Home > Articles

This chapter is from the book

Examples

Example: Rethrowing a modified exception. Prefer to rethrow using throw; :

catch( MyException& e ) {                   // catch by reference to non-const
 e.AppendContext("Passed through here");    // modify
 
   throw;                                     
   // rethrow modified object
}

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.