Show main exception only with --verbose

This commit is contained in:
Lukas Zapletal 2014-04-28 09:48:17 +02:00
parent 6c526fd645
commit b42b3dbce5
1 changed files with 20 additions and 14 deletions

View File

@ -402,6 +402,7 @@ def websockify_init():
try: opts.target_port = int(opts.target_port)
except: parser.error("Error parsing target port")
try:
# Transform to absolute path as daemon may chdir
if opts.target_cfg:
opts.target_cfg = os.path.abspath(opts.target_cfg)
@ -417,6 +418,11 @@ def websockify_init():
# Use internal service framework
server = WebSocketProxy(**opts.__dict__)
server.start_server()
except:
if opts.verbose:
raise
else:
print >> sys.stderr, 'Unexpected error:', sys.exc_info()[1]
class LibProxyServer(ForkingMixIn, HTTPServer):