try { //do something } catch (const std::exception& e) { std::cout << e.what(); // information from error printed }