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::SCrypt;
|
||||||
using cpputils::CurlHttpClient;
|
using cpputils::CurlHttpClient;
|
||||||
using std::make_shared;
|
using std::make_shared;
|
||||||
|
using std::cerr;
|
||||||
using cpputils::IOStreamConsole;
|
using cpputils::IOStreamConsole;
|
||||||
|
|
||||||
int main(int argc, const char *argv[]) {
|
int main(int argc, const char *argv[]) {
|
||||||
auto &keyGenerator = Random::OSRandom();
|
try {
|
||||||
return Cli(keyGenerator, SCrypt::DefaultSettings, make_shared<IOStreamConsole>(), make_shared<CurlHttpClient>()).main(argc, argv);
|
auto &keyGenerator = Random::OSRandom();
|
||||||
|
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