33 #ifndef __H_COMMON_CATCH_STD_H_
34 #define __H_COMMON_CATCH_STD_H_
39 #define UG_LOG_CATCH(expr)\
40 UG_LOG_ALL_PROCS( "\nA std::exception has been thrown:\n"\
41 "Description: " << expr << "\n"\
42 "File: " << __FILE__ << "\n"\
43 "Line: " << __LINE__ << "\n\n"); \
46 #define UG_LOG_CATCH(expr) UG_ASSERT(false, "A std::exception has been thrown:\n" << expr)
49 #define CATCH_STD_EXCEPTIONS()\
50 catch(std::bad_alloc& ex) { UG_LOG_CATCH("bad_alloc caught: " << ex.what() << "\nThis is mostly caused by an OUT OF MEMORY - condition.\n"\
51 << "You might have to reduce your problem size, go parallel or increase memory.") } \
52 catch(std::bad_cast& ex) { UG_LOG_CATCH("bad_cast caught: " << ex.what() << "\nThis is caused by a Casting error in classes.") } \
53 catch(std::exception& ex) { UG_LOG_CATCH("std::exception caught: " << ex.what() << "\n.") } \