1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-27 19:04:15 +01:00

Fixed some error messages

'socket.gaierror' is caught when we are unable to resolve the host name into the IP address. 'OSError' is caught when the host is invalid. I have now used the appropriate messages.
This commit is contained in:
Mitul16 2021-07-18 02:30:17 +05:30
parent eae6440145
commit b511a37f71

View File

@ -48,9 +48,11 @@ class Connect(Socket):
try:
client = socket.create_connection((host, port))
except socket.gaierror:
raise ChannelError(self, "invalid host provided")
raise ChannelError(self, "unable to resolve host")
except ConnectionRefusedError:
raise ChannelError(self, "connection refused, check your port")
except OSError:
raise ChannelError(self, "invalid host provided")
progress.log(
f"connection to "