Added some exception handling
parent
2f4d484702
commit
ab6d1bd5a6
|
@ -11,6 +11,7 @@ namespace OpenGridServices.Manager
|
|||
|
||||
public bool Connect(string GridServerURL, string username, string password)
|
||||
{
|
||||
try {
|
||||
this.ServerURL=GridServerURL;
|
||||
Hashtable LoginParamsHT = new Hashtable();
|
||||
LoginParamsHT["username"]=username;
|
||||
|
@ -24,6 +25,10 @@ namespace OpenGridServices.Manager
|
|||
} else {
|
||||
return true;
|
||||
}
|
||||
} catch(Exception e) {
|
||||
Console.WriteLine(e.ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,11 @@ namespace OpenGridServices.Manager
|
|||
switch(cmd) {
|
||||
case "connect_to_gridserver":
|
||||
win.SetStatus("Connecting to grid server...");
|
||||
gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3]);
|
||||
if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) {
|
||||
win.SetStatus("Connected OK");
|
||||
} else {
|
||||
win.SetStatus("Could not connect");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue