]> arthur.barton.de Git - bup.git/commitdiff
cmd/web: print a nicer message if we can't bind the socket.
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 13 Jul 2010 20:24:56 +0000 (16:24 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 13 Jul 2010 20:25:14 +0000 (16:25 -0400)
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/web-cmd.py

index b4120449e78576136e711b402af707b43916c05d..29523158ee0882065ceeb39322423781dabedb80 100755 (executable)
@@ -185,8 +185,12 @@ if len(extra) > 0:
 git.check_repo_or_die()
 top = vfs.RefList(None)
 
-httpd = BupHTTPServer(address, BupRequestHandler)
+try:
+    httpd = BupHTTPServer(address, BupRequestHandler)
+except socket.error, e:
+    log('socket%r: %s\n' % (address, e.args[1]))
+    sys.exit(1)
+
 sa = httpd.socket.getsockname()
-print "Serving HTTP on %s:%d..." % sa
-sys.stdout.flush()
+log("Serving HTTP on %s:%d...\n" % sa)
 httpd.serve_forever()