Catch exceptions from main
This commit is contained in:
parent
dbc1b5db8c
commit
a1c3079a68
@ -8,9 +8,15 @@ using cpputils::Random;
|
||||
using cpputils::SCrypt;
|
||||
using cpputils::CurlHttpClient;
|
||||
using std::make_shared;
|
||||
using std::cerr;
|
||||
using cpputils::IOStreamConsole;
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
try {
|
||||
auto &keyGenerator = Random::OSRandom();
|
||||
return Cli(keyGenerator, SCrypt::DefaultSettings, make_shared<IOStreamConsole>(), make_shared<CurlHttpClient>()).main(argc, argv);
|
||||
return Cli(keyGenerator, SCrypt::DefaultSettings, make_shared<IOStreamConsole>(),
|
||||
make_shared<CurlHttpClient>()).main(argc, argv);
|
||||
} catch (const std::exception &e) {
|
||||
cerr << "Error: " << e.what();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user