try { // do work } catch (...) { // cleanup std::rethrow_exception(std::current_exception()); } // cleanup