A feature-rich command-line audio/video downloader
[socks] Refine exception model for better error handling
Yen Chi Hsuan4bd7d9d4ae05
diff --git a/youtube_dl/socks.py b/youtube_dl/socks.pyindex fece280626..0f5d7bdb21 100644--- a/youtube_dl/socks.py+++ b/youtube_dl/socks.py@@ -55,7 +55,7 @@ class Socks5AddressType(object):ATYP_IPV6 = 0x04-class ProxyError(IOError):+class ProxyError(socket.error):ERR_SUCCESS = 0x00def __init__(self, code=None, msg=None):@@ -123,7 +123,7 @@ class sockssocket(socket.socket):while len(data) < cnt:cur = self.recv(cnt - len(data))if not cur:- raise IOError('{0} bytes missing'.format(cnt - len(data)))+ raise EOFError('{0} bytes missing'.format(cnt - len(data)))data += curreturn data