Just write to stderr when exceptions are uncaught

This commit is contained in:
Maxime Coste 2016-03-03 13:56:42 +00:00
parent b5b5b82c70
commit 134be9a1f6

View File

@ -805,17 +805,17 @@ int main(int argc, char* argv[])
} }
catch (Kakoune::exception& error) catch (Kakoune::exception& error)
{ {
on_assert_failed(format("uncaught exception ({}):\n{}", typeid(error).name(), error.what()).c_str()); write_stderr(format("uncaught exception ({}):\n{}", typeid(error).name(), error.what()));
return -1; return -1;
} }
catch (std::exception& error) catch (std::exception& error)
{ {
on_assert_failed(format("uncaught exception ({}):\n{}", typeid(error).name(), error.what()).c_str()); write_stderr(format("uncaught exception ({}):\n{}", typeid(error).name(), error.what()));
return -1; return -1;
} }
catch (...) catch (...)
{ {
on_assert_failed("uncaught exception"); write_stderr("uncaught exception");
return -1; return -1;
} }
return 0; return 0;