Hi Team, I need to create an object for catched exception . class exception: virtual public std::exception ,virtual public boost::exception {} inside my application code, try{ boost::rethrow_exception(exceptr)} catch(std::exception &e) { std::exception *e = stacktoHeapObject(e); } static std::exception* stacktoHeapObj(std::exception* e) { if (dynamic_caststd::bad_alloc*(e)) { return new std::bad_alloc(*(dynamic_caststd::bad_alloc*(e))); } else if (dynamic_caststd::bad_cast*(e)) { return new std::bad_cast(*(dynamic_caststd::bad_cast*(e))); } else if (dynamic_caststd::bad_typeid*(e)) { return new std::bad_typeid(*(dynamic_caststd::bad_typeid*(e))); } else if (dynamic_caststd::bad_exception*(e)) { return new std::bad_exception(*(dynamic_caststd::bad_exception*(e))); } else if (dynamic_caststd::domain_error*(e)) { return new std::domain_error(*(dynamic_caststd::domain_error*(e))); } else if (dynamic_caststd::invalid_argument*(e)) { return new std::invalid_argument(*(dynamic_caststd::invalid_argument*(e))); } else if (dynamic_caststd::length_error*(e)) { return new std::length_error(*(dynamic_caststd::length_error*(e))); } else if (dynamic_caststd::out_of_range*(e)) { return new std::out_of_range(*(dynamic_caststd::out_of_range*(e))); } else if (dynamic_caststd::overflow_error*(e)) { return new std::overflow_error(*(dynamic_caststd::overflow_error*(e))); } else if (dynamic_caststd::range_error*(e)) { return new std::range_error(*(dynamic_caststd::range_error*(e))); } else if (dynamic_caststd::underflow_error*(e)) { return new std::underflow_error(*(dynamic_caststd::underflow_error*(e))); } else if (dynamic_caststd::runtime_error*(e)) { return new std::runtime_error(*(dynamic_caststd::runtime_error*(e))); } else if (dynamic_caststd::exception*(e)) { return new std::exception(*(dynamic_caststd::exception*(e))); } } I have coded by taking order reference of below pic. please help me to get classes names in boost:exception which are not in std::exception . if they are in boost::exception only then how to catch that and send to stackToHeapObj and what order i need to follow to add those if checks. try { boost::rethrow_exception(exptr) } here in catch block , we don't know which exception type we have in exptr(ie. std:: or boost:;) then How to catch them. if i use std::exception in catch block then if exptr throws boost::exception type then ... and viceversa..? Please help me to clarify above queries [image: image.png]