##// END OF EJS Templates
hgweb: pass ErrorResponses directly into req.respond()
Dirkjan Ochtman -
r7740:176d3d68 default
parent child Browse files
Show More
@@ -99,7 +99,7 b' class hgweb(object):'
99 method = getattr(protocol, cmd)
99 method = getattr(protocol, cmd)
100 return method(self.repo, req)
100 return method(self.repo, req)
101 except ErrorResponse, inst:
101 except ErrorResponse, inst:
102 req.respond(inst.code, protocol.HGTYPE)
102 req.respond(inst, protocol.HGTYPE)
103 if not inst.message:
103 if not inst.message:
104 return []
104 return []
105 return '0\n%s\n' % inst.message,
105 return '0\n%s\n' % inst.message,
@@ -194,7 +194,7 b' class hgweb(object):'
194 req.respond(HTTP_SERVER_ERROR, ctype)
194 req.respond(HTTP_SERVER_ERROR, ctype)
195 return tmpl('error', error=str(inst))
195 return tmpl('error', error=str(inst))
196 except ErrorResponse, inst:
196 except ErrorResponse, inst:
197 req.respond(inst.code, ctype)
197 req.respond(inst, ctype)
198 return tmpl('error', error=inst.message)
198 return tmpl('error', error=inst.message)
199
199
200 def templater(self, req):
200 def templater(self, req):
@@ -168,7 +168,7 b' class hgwebdir(object):'
168 return tmpl("notfound", repo=virtual)
168 return tmpl("notfound", repo=virtual)
169
169
170 except ErrorResponse, err:
170 except ErrorResponse, err:
171 req.respond(err.code, ctype)
171 req.respond(err, ctype)
172 return tmpl('error', error=err.message or '')
172 return tmpl('error', error=err.message or '')
173 finally:
173 finally:
174 tmpl = None
174 tmpl = None
General Comments 0
You need to be logged in to leave comments. Login now