What types of exceptions your program uses depends only on the compiler, Code::Blocks has nothing to do with it.
The TDM compiler suite has a DW2 variant which works reliably, to name one example. Though of course you could just rebuild OpenCV using your compiler instead, too.