diff options
-rw-r--r-- | src/webstat_logger_main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/webstat_logger_main.cpp b/src/webstat_logger_main.cpp index 7817dc0..d30da80 100644 --- a/src/webstat_logger_main.cpp +++ b/src/webstat_logger_main.cpp @@ -57,6 +57,12 @@ main(int argc, char ** argv) po::notify(optVars); auto pool = std::make_shared<DB::ConnectionPool>(dbMax, dbKeep, std::move(dbType), std::move(dbConnStr)); - WebStat::Ingestor {getHostDetail(), pool}.ingestLog(stdin); - return EXIT_SUCCESS; + try { + WebStat::Ingestor {getHostDetail(), pool}.ingestLog(stdin); + return EXIT_SUCCESS; + } + catch (const std::exception & excp) { + std::println(std::cerr, "Unhandled error: {}", excp.what()); + return EXIT_FAILURE; + } } |