diff --git a/src/cxxlinkaheadcli.cpp b/src/cxxlinkaheadcli.cpp
index 8b3b7f918505fa1c4613614eb1dd26f7dcb491b4..3626d96835d6447d60e8df3a53370099b3eabe8d 100644
--- a/src/cxxlinkaheadcli.cpp
+++ b/src/cxxlinkaheadcli.cpp
@@ -43,20 +43,27 @@ const auto logger_name = "liblinkahead";
 
 auto main() -> int {
 
-  std::cout << "LinkAhead C++ client (liblinkahead " << linkahead::LIBLINKAHEAD_VERSION_MINOR << "."
+  std::cout << "LinkAhead C++ client (liblinkahead " << linkahead::LIBLINKAHEAD_VERSION_MAJOR << "."
             << linkahead::LIBLINKAHEAD_VERSION_MINOR << "." << linkahead::LIBLINKAHEAD_VERSION_PATCH
-            << ")\n"
-            << std::endl;
+            << ")\n";
 
   try {
     const auto &connection = linkahead::connection::ConnectionManager::GetDefaultConnection();
 
-    connection->RetrieveVersionInfoNoExceptions();
+    auto status = connection->RetrieveVersionInfoNoExceptions();
+    if (status.GetCode() == linkahead::CONNECTION_ERROR) {
+      const auto connection_config =
+        linkahead::configuration::ConfigurationManager::GetDefaultConnectionConfiguration();
+      std::cout << "ConnectionError: Cannot connect to " << connection_config->GetHost() << ":"
+                << connection_config->GetPort() << '\n';
+
+      return 1;
+    }
     // get version info of the server
     const auto &v_info = connection->GetVersionInfo();
     std::cout << "Server Version: " << v_info->GetMajor() << "." << v_info->GetMinor() << "."
               << v_info->GetPatch() << "-" << v_info->GetPreRelease() << "-" << v_info->GetBuild()
-              << std::endl;
+              << '\n';
 
     // retrieve an entity
     auto transaction(connection->CreateTransaction());
@@ -67,12 +74,12 @@ auto main() -> int {
       << "status: " << t_stat.GetCode() << " // " << t_stat.GetDescription();
     const auto &result_set = transaction->GetResultSet();
     for (const auto &entity : result_set) {
-      std::cout << entity.ToString() << std::endl;
+      std::cout << entity.ToString() << '\n';
     }
 
     // execute a query
     std::string query("FIND Property \"Prop *\"");
-    std::cout << "Trying to execute a query:\n" << query << std::endl;
+    std::cout << "Trying to execute a query:\n" << query << '\n';
     auto q_transaction(connection->CreateTransaction());
     q_transaction->Query(query);
     q_transaction->ExecuteAsynchronously();
@@ -81,18 +88,18 @@ auto main() -> int {
       << "status: " << t_stat.GetCode() << " // " << t_stat.GetDescription();
     const auto &result_set_2 = q_transaction->GetResultSet();
     for (const auto &entity : result_set_2) {
-      std::cout << entity.ToString() << std::endl;
+      std::cout << entity.ToString() << '\n';
     }
 
     return 0;
   } catch (const linkahead::exceptions::ConfigurationError &exc) {
-    std::cout << "ConfigurationError: " << exc.what() << std::endl;
+    std::cout << "ConfigurationError: " << exc.what() << '\n';
     return exc.GetCode();
   } catch (const std::exception &exc) {
-    std::cout << "Exception: " << exc.what() << std::endl;
+    std::cout << "Exception: " << exc.what() << '\n';
     return 1;
   } catch (...) {
-    std::cout << "Some other exception." << std::endl;
+    std::cout << "Some other exception." << '\n';
     return 2;
   }
 }