comparison mercurial/hgweb/request.py @ 9694:8269fe2d48f6

hgweb: send proper error messages to the client Fixes a bug in protocol which caused an exception during exception handling in some cases on Windows. Also makes sure the server error message is correctly propagated to the client, instead of being thrown away.
author Sune Foldager <cryo@cyanite.org>
date Mon, 02 Nov 2009 10:20:04 +0100
parents 46293a0c7e9f
children 5eae671c0b57
comparison
equal deleted inserted replaced
9693:c40a1ee20aa5 9694:8269fe2d48f6
75 if not isinstance(v, str): 75 if not isinstance(v, str):
76 raise TypeError('header value must be string: %r' % v) 76 raise TypeError('header value must be string: %r' % v)
77 77
78 if isinstance(status, ErrorResponse): 78 if isinstance(status, ErrorResponse):
79 self.header(status.headers) 79 self.header(status.headers)
80 status = statusmessage(status.code) 80 status = statusmessage(status.code, status.message)
81 elif status == 200: 81 elif status == 200:
82 status = '200 Script output follows' 82 status = '200 Script output follows'
83 elif isinstance(status, int): 83 elif isinstance(status, int):
84 status = statusmessage(status) 84 status = statusmessage(status)
85 85