Код: Выделить всё
void
promise_type::unhandled_exception() noexcept
{
try {
// re-throw current exception
throw;
} catch (const std::exception &e) {
std::println(stderr, "unhandled exception in coroutine: {}",
e.what());
std::terminate();
} catch (...) {
std::println(stderr, "non-std::exception thrown");
std::terminate();
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... with-throw
Мобильная версия