C++ exceptions helpers