Pass on exceptions to exit_code future in main

This commit is contained in:
Stephen Shelton 2020-07-01 08:21:53 -06:00
parent eb2260179f
commit a448cbab4f
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C
1 changed files with 2 additions and 2 deletions

View File

@ -117,12 +117,12 @@ run_main_context(const fs::path confFile, const llarp::RuntimeOptions opts)
catch (std::exception& e)
{
llarp::LogError("Fatal: caught exception while running: ", e.what());
exit_code.set_value(1);
exit_code.set_exception(e);
}
catch (...)
{
llarp::LogError("Fatal: caught non-standard exception while running");
exit_code.set_value(2);
exit_code.set_exception(std::runtime_error("Non-standard exception caught while running");
}
}