# HG changeset patch # User Sune Foldager # Date 1234175512 -3600 # Node ID a3d7f99c23c0720a5b58405cf473351f8346d429 # Parent 176d3d6817026cfe40f19fee0d5e8cdbbb473139 hgweb: support custom http headers in ErrorResponse diff -r 176d3d681702 -r a3d7f99c23c0 mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py Mon Feb 09 11:29:09 2009 +0100 +++ b/mercurial/hgweb/common.py Mon Feb 09 11:31:52 2009 +0100 @@ -17,9 +17,10 @@ HTTP_SERVER_ERROR = 500 class ErrorResponse(Exception): - def __init__(self, code, message=None): + def __init__(self, code, message=None, headers=[]): Exception.__init__(self) self.code = code + self.headers = headers if message is not None: self.message = message else: diff -r 176d3d681702 -r a3d7f99c23c0 mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py Mon Feb 09 11:29:09 2009 +0100 +++ b/mercurial/hgweb/request.py Mon Feb 09 11:31:52 2009 +0100 @@ -77,6 +77,7 @@ if isinstance(status, ErrorResponse): status = statusmessage(status.code) + self.header(status.headers) elif status == 200: status = '200 Script output follows' elif isinstance(status, int):