Browse Source

if connection is lost, the GUI now receives a connectionerror json

Denys 4 years ago
parent
commit
2f2d052d61
3 changed files with 3 additions and 1 deletions
  1. 1 0
      cli/src/batchioman.cpp
  2. 1 1
      cli/src/ioman.cpp
  3. 1 0
      cli/src/userioman.cpp

+ 1 - 0
cli/src/batchioman.cpp

@@ -12,6 +12,7 @@ BatchIoMan::BatchIoMan(bool usessl, const char *certfile, bool beverbose, std::s
 
 	/* initialize print command map */
 	printmap["error"] = &BatchIoMan::printError;
+	printmap["connectionerror"] = &BatchIoMan::printError;
 	printmap["connect"] = &BatchIoMan::printConnect;
 	printmap["help"] = &BatchIoMan::printHelp;
 	printmap["status"] = &BatchIoMan::printStatus;

+ 1 - 1
cli/src/ioman.cpp

@@ -594,7 +594,7 @@ void IoMan::run() {
 			// cmdman gets informed inside disconnect method
 			// inform the user by giving output
 			Json::Value root;
-			root["command"] = "error";
+			root["command"] = "connectionerror";
 			root["error"] = "The server does not respond. You are now disconnected.";
 			printMessage(Json::writeString(wbuilder, root), normal);
 

+ 1 - 0
cli/src/userioman.cpp

@@ -13,6 +13,7 @@ UserIoMan::UserIoMan(bool usessl, const char *certfile, bool beverbose) : IoMan(
 
 	/* initialize print command map */
 	printmap["error"] = &UserIoMan::printError;
+	printmap["connectionerror"] = &UserIoMan::printError;
 	printmap["connect"] = &UserIoMan::printConnect;
 	printmap["help"] = &UserIoMan::printHelp;
 	printmap["extendedstatus"] = &UserIoMan::printExtendedstatus;