Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgweb_mod.py @ 6368:2c370f08c486
hgweb: better error messages
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sun, 23 Mar 2008 23:08:18 +0100 |
parents | cf1fa60fdaf4 |
children | 31a01e3d99cc |
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py Sun Mar 23 22:15:47 2008 +0100 +++ b/mercurial/hgweb/hgweb_mod.py Sun Mar 23 23:08:18 2008 +0100 @@ -234,7 +234,7 @@ cmd = req.form['cmd'][0] if cmd not in webcommands.__all__: - msg = 'No such method: %s' % cmd + msg = 'no such method: %s' % cmd raise ErrorResponse(HTTP_BAD_REQUEST, msg) elif cmd == 'file' and 'raw' in req.form.get('style', []): self.ctype = ctype @@ -248,7 +248,11 @@ except revlog.LookupError, err: req.respond(HTTP_NOT_FOUND, ctype) - req.write(tmpl('error', error='revision not found: %s' % err.name)) + if 'manifest' in err.message: + msg = str(err) + else: + msg = 'revision not found: %s' % err.name + req.write(tmpl('error', error=msg)) except (RepoError, revlog.RevlogError), inst: req.respond(HTTP_SERVER_ERROR, ctype) req.write(tmpl('error', error=str(inst))) @@ -737,7 +741,7 @@ files[short] = (f, n) if not files: - raise ErrorResponse(HTTP_NOT_FOUND, 'Path not found: ' + path) + raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path) def filelist(**map): fl = files.keys()