C++ exceptions framework