Skip to content

Commit

Permalink
#1105 / #1536: catch failures to connect to the system wide proxy and…
Browse files Browse the repository at this point in the history
… fall through (log a warning), also better exception messages in case of connection failures

git-svn-id: https://xpra.org/svn/Xpra/trunk@16023 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 5, 2017
1 parent b7e12d8 commit 313bc35
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,10 +1326,18 @@ def run_mode(script_file, error_cb, options, args, mode, defaults):
if start_via_proxy is True:
error_cb("cannot start-via-proxy: xpra client is not installed")
else:
r = run_client(error_cb, options, args, "request-%s" % mode)
if r:
raise InitException("failed to start-via-proxy: %s" % EXIT_STR.get(r, r))
return r
err = None
try:
r = run_client(error_cb, options, args, "request-%s" % mode)
if r==0:
return
err = EXIT_STR.get(r, r)
except Exception as e:
err = str(e)
if start_via_proxy is True:
raise InitException("failed to start-via-proxy: %s" % err)
else:
warn("Warning: cannot use the system proxy for '%s' subcommand,\n %s" % (mode, err))
current_display = nox()
try:
from xpra import server
Expand Down Expand Up @@ -1929,6 +1937,8 @@ def sockpathfail_cb(msg):
#now that we know it:
if "socket_dir" not in display_desc:
display_desc["socket_dir"] = os.path.dirname(sockpath)
except (InitException, InitExit, InitInfo) as e:
raise
except Exception as e:
raise InitException("cannot connect to %s: %s" % (sockpath, e))
conn.timeout = SOCKET_TIMEOUT
Expand Down

0 comments on commit 313bc35

Please sign in to comment.