##// END OF EJS Templates
hgweb: remove ErrorResponse.message...
timeless@mozdev.org -
r26200:461e7b70 default
parent child Browse files
Show More
@@ -80,12 +80,9 b' class ErrorResponse(Exception):'
80 def __init__(self, code, message=None, headers=[]):
80 def __init__(self, code, message=None, headers=[]):
81 if message is None:
81 if message is None:
82 message = _statusmessage(code)
82 message = _statusmessage(code)
83 Exception.__init__(self)
83 Exception.__init__(self, message)
84 self.code = code
84 self.code = code
85 self.message = message
86 self.headers = headers
85 self.headers = headers
87 def __str__(self):
88 return self.message
89
86
90 class continuereader(object):
87 class continuereader(object):
91 def __init__(self, f, write):
88 def __init__(self, f, write):
@@ -356,7 +356,7 b' class hgweb(object):'
356 else:
356 else:
357 req.headers.append(('Connection', 'Close'))
357 req.headers.append(('Connection', 'Close'))
358 req.respond(inst, protocol.HGTYPE,
358 req.respond(inst, protocol.HGTYPE,
359 body='0\n%s\n' % inst.message)
359 body='0\n%s\n' % inst)
360 return ''
360 return ''
361
361
362 # translate user-visible url structure to internal structure
362 # translate user-visible url structure to internal structure
@@ -439,7 +439,7 b' class hgweb(object):'
439 if inst.code == HTTP_NOT_MODIFIED:
439 if inst.code == HTTP_NOT_MODIFIED:
440 # Not allowed to return a body on a 304
440 # Not allowed to return a body on a 304
441 return ['']
441 return ['']
442 return tmpl('error', error=inst.message)
442 return tmpl('error', error=str(inst))
443
443
444 def check_perm(self, rctx, req, op):
444 def check_perm(self, rctx, req, op):
445 for permhook in permhooks:
445 for permhook in permhooks:
@@ -100,7 +100,7 b' class wsgirequest(object):'
100 self.headers = [(k, v) for (k, v) in self.headers if
100 self.headers = [(k, v) for (k, v) in self.headers if
101 k in ('Date', 'ETag', 'Expires',
101 k in ('Date', 'ETag', 'Expires',
102 'Cache-Control', 'Vary')]
102 'Cache-Control', 'Vary')]
103 status = statusmessage(status.code, status.message)
103 status = statusmessage(status.code, str(status))
104 elif status == 200:
104 elif status == 200:
105 status = '200 Script output follows'
105 status = '200 Script output follows'
106 elif isinstance(status, int):
106 elif isinstance(status, int):
General Comments 0
You need to be logged in to leave comments. Login now