diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -1403,7 +1403,7 @@ def help(web, req, tmpl): try: doc = helpmod.help_(u, commands, topic, subtopic=subtopic) - except error.UnknownCommand: + except error.Abort: raise ErrorResponse(HTTP_NOT_FOUND) return tmpl('help', topic=topicname, doc=doc) diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -3391,6 +3391,70 @@ Sub-topic topics rendered properly + $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic" + 404 Not Found + + + + + + + + + + test: error + + + +
+ + +
+ + +

error

+ + + + +
+

+ An error occurred while processing your request: +

+

+ Not Found +

+
+
+
+ + + + + + + [1] + $ killdaemons.py #endif