int main() try { ... } catch (std::exception & e) { // do something with what... } catch (...) { // someone threw something undecypherable }