MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / mainEntryClickHouseClient

Function mainEntryClickHouseClient

programs/client/Client.cpp:1367–1395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1365int mainEntryClickHouseClient(int argc, char ** argv);
1366
1367int 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}

Callers

nothing calls this directly

Calls 6

getCurrentExceptionCodeFunction · 0.85
initMethod · 0.45
runMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected