ExceptionDefine.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef EXCEPTIONDEFINE_HH_
00018 # define EXCEPTIONDEFINE_HH_
00019
00028
00029
00030
00031 # define THROW(Excpt, Msg) \
00032 do { \
00033 std::ostringstream os; \
00034 os << Msg; \
00035 throw Excpt(os.rdbuf()->str()); \
00036 } while (0)
00037
00038 # define PRINT_AND_THROW(Excpt, Msg) \
00039 do { \
00040 std::ostringstream os; \
00041 os << Msg; \
00042 Excpt e(os.rdbuf()->str()); \
00043 ERR("Throwing " #Excpt ": %1", e.what()); \
00044 throw e; \
00045 } while (0)
00046
00048
00049 #endif