| 1365 | int mainEntryClickHouseClient(int argc, char ** argv); |
| 1366 | |
| 1367 | int mainEntryClickHouseClient(int argc, char ** argv) |
| 1368 | { |
| 1369 | DB::MainThreadStatus::getInstance(); |
| 1370 | |
| 1371 | try |
| 1372 | { |
| 1373 | DB::Client client; |
| 1374 | // Initialize command line options |
| 1375 | client.init(argc, argv); |
| 1376 | return client.run(); |
| 1377 | } |
| 1378 | catch (DB::Exception & e) |
| 1379 | { |
| 1380 | std::cerr << DB::getExceptionMessageForLogging(e, false) << std::endl; |
| 1381 | auto code = DB::getCurrentExceptionCode(); |
| 1382 | return static_cast<UInt8>(code) ? code : 1; |
| 1383 | } |
| 1384 | catch (const boost::program_options::error & e) |
| 1385 | { |
| 1386 | std::cerr << "Bad arguments: " << e.what() << std::endl; |
| 1387 | return DB::ErrorCodes::BAD_ARGUMENTS; |
| 1388 | } |
| 1389 | catch (...) |
| 1390 | { |
| 1391 | std::cerr << DB::getCurrentExceptionMessage(true) << '\n'; |
| 1392 | auto code = DB::getCurrentExceptionCode(); |
| 1393 | return static_cast<UInt8>(code) ? code : 1; |
| 1394 | } |
| 1395 | } |
nothing calls this directly
no test coverage detected