changed error codes. the higher the code the lower the error.

This commit is contained in:
Johannes Findeisen 2013-08-18 23:41:23 +02:00
commit 7975061721

View file

@ -26,14 +26,14 @@ class TcpconnectService(Service):
try: try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg: except socket.error, msg:
jobInfo.set_errorcode(1) jobInfo.set_errorcode(2)
jobInfo.set_message("Could not create socket to host: " + jobInfo.get_host() + " on port: " + jobInfo.set_message("Could not create socket to host: " + jobInfo.get_host() + " on port: " +
str(self.port) + " (" + str(msg) + ")") str(self.port) + " (" + str(msg) + ")")
try: try:
sock.connect((jobInfo.get_host(), self.port)) sock.connect((jobInfo.get_host(), self.port))
except socket.error, msg: except socket.error, msg:
jobInfo.set_errorcode(2) jobInfo.set_errorcode(1)
jobInfo.set_message("Could not establish connection to host: " + jobInfo.get_host() + " on port: " + jobInfo.set_message("Could not establish connection to host: " + jobInfo.get_host() + " on port: " +
str(self.port) + " (" + str(msg) + ")") str(self.port) + " (" + str(msg) + ")")