summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/pvsConnectionManager.cpp76
1 files changed, 56 insertions, 20 deletions
diff --git a/src/core/pvsConnectionManager.cpp b/src/core/pvsConnectionManager.cpp
index db302c4..d1442dd 100644
--- a/src/core/pvsConnectionManager.cpp
+++ b/src/core/pvsConnectionManager.cpp
@@ -226,33 +226,69 @@ void PVSConnectionManager::onCommand(PVSMsg command)
QString id = int2String(command.getSndID());
if (message.startsWith("START"))
{
- QString msgcontent = message.remove(0,6);
- if (msgcontent.startsWith("ERROR"))
- {
- ConsoleLog writeError("[Client: " + id + ", PROCESS] could not start: " +msgcontent.remove(0,6));
- }
- else
+ message.remove(0,6);
+ if (message.startsWith("ERROR"))
{
- //ConsoleLog writeLine(QString("[Client: " + id + ", PROCESS] started: " +msgcontent));
+ int e = string2Int(message.remove(0,6));
+ message.remove(0,2);
+ switch (e)
+ {
+ case 0:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] could not start: "+message+" is missing or insufficient permissions");
+ break;
+ case 1:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" crashed");
+ break;
+ case 2:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" timed out");
+ break;
+ case 3:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" read error");
+ break;
+ case 4:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" write error");
+ break;
+ default:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+": unknown error");
+ break;
+ }
}
}
- if (message.startsWith("STOP"))
- {
- QString msgcontent = message.remove(0,5);
- if (msgcontent.startsWith("ERROR"))
- {
- ConsoleLog writeError("[Client: " + id + ", PROCESS] could not stop: " +msgcontent.remove(0,6));
- }
- else
- {
- //ConsoleLog writeLine(QString("[Client: " + id + ", PROCESS] stopped: " +msgcontent));
- }
+ else if (message.startsWith("STOP"))
+ {
+ message.remove(0,5);
+ if (message.startsWith("ERROR"))
+ {
+ int e = string2Int(message.remove(0,6));
+ message.remove(0,2);
+ switch (e)
+ {
+ case 0:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] could not stop: "+message+" is missing or insufficient permissions");
+ break;
+ case 1:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" crashed");
+ break;
+ case 2:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" timed out");
+ break;
+ case 3:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" read error");
+ break;
+ case 4:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+" write error");
+ break;
+ default:
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] "+message+": unknown error");
+ break;
+ }
+ }
}
- if (message.startsWith("SHOW"))
+ else if (message.startsWith("SHOW"))
{
QString msgcontent = message.remove(0,5);
if (msgcontent.startsWith("ERROR"))
- ConsoleLog writeError("[Client: " + id + ", PROCESS] could not show processes: " +msgcontent.remove(0,6));
+ ConsoleLog writeError("[Client: " + id + ", PROCESS] could not show processes.");
else if (msgcontent.startsWith("clear"))
tmp->clearProcessesVector();
else if (msgcontent.startsWith("finished"))