From 48fff0009ab070a433840395b0f64f22c0eb10e3 Mon Sep 17 00:00:00 2001 From: MuxZeroNet Date: Sun, 8 Jan 2017 01:31:44 +0000 Subject: [PATCH] Fix Unhandled Exception SOCKS5Error --- src/util/UpnpPunch.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/UpnpPunch.py b/src/util/UpnpPunch.py index 1e47d6a3a..e87579464 100644 --- a/src/util/UpnpPunch.py +++ b/src/util/UpnpPunch.py @@ -81,10 +81,16 @@ def _retrieve_igd_profile(url): """ Retrieve the device's UPnP profile. """ + + from lib.PySocks.socks import SOCKS5Error + try: return urllib2.urlopen(url.geturl(), timeout=5).read() except socket.error: raise IGDError('IGD profile query timed out') + except SOCKS5Error: + logging.info("Warning: SOCKS server refused our UPnP request.") + raise IGDError('IGD profile query failed - SOCKS server failure') def _get_first_child_data(node):