Commit d22f85e0 authored by Chris McDonough's avatar Chris McDonough

Caused the error description associated with a notFound error to appear in the...

Caused the error description associated with a notFound error to appear in the default traceback as "Reason: <error description>".
parent b9f009aa
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
'''CGI Response Output formatter '''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.46 2001/04/24 15:59:49 andreas Exp $''' $Id: HTTPResponse.py,v 1.47 2001/08/07 16:07:42 chrism Exp $'''
__version__='$Revision: 1.46 $'[11:-2] __version__='$Revision: 1.47 $'[11:-2]
import string, types, sys, re import string, types, sys, re
from string import find, rfind, lower, upper, strip, split, join, translate from string import find, rfind, lower, upper, strip, split, join, translate
...@@ -540,13 +540,13 @@ class HTTPResponse(BaseResponse): ...@@ -540,13 +540,13 @@ class HTTPResponse(BaseResponse):
</BODY> </BODY>
</HTML>""") </HTML>""")
def notFoundError(self,entry='who knows!'): def notFoundError(self,entry='Unknown'):
self.setStatus(404) self.setStatus(404)
raise 'NotFound',self._error_html( raise 'NotFound',self._error_html(
"Resource not found", "Resource not found",
"Sorry, the requested resource does not exist.<p>" + "Sorry, the requested resource does not exist." +
"Check the URL and try again.<p>" + "<p>Check the URL and try again.</p>" +
"\n<!--\n%s\n-->" % entry) "<p><b>Reason:</b> %s</p>" % self.quoteHTML(entry))
forbiddenError=notFoundError # If a resource is forbidden, forbiddenError=notFoundError # If a resource is forbidden,
# why reveal that it exists? # why reveal that it exists?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment