# HG changeset patch # User Bryan O'Sullivan # Date 2005-08-31 18:19:20 # Node ID 862f53c1d0f93399e4c57fabbbebc17db43dad0b # Parent ba4ce38b90a3b419d3aeaf3e40b54afc0ba27e31 hg serve: print a more useful error message if server can't start. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1386,7 +1386,10 @@ def serve(ui, repo, **opts): if opts[o]: ui.setconfig("web", o, opts[o]) - httpd = hgweb.create_server(repo) + try: + httpd = hgweb.create_server(repo) + except socket.error, inst: + raise util.Abort('cannot start server: ' + inst.args[1]) if ui.verbose: addr, port = httpd.socket.getsockname()