440 subdir = virtual + '/' |
441 subdir = virtual + '/' |
441 if [r for r in repos if r.startswith(subdir)]: |
442 if [r for r in repos if r.startswith(subdir)]: |
442 return self.makeindex(req, res, tmpl, subdir) |
443 return self.makeindex(req, res, tmpl, subdir) |
443 |
444 |
444 # prefixes not found |
445 # prefixes not found |
445 wsgireq.respond(HTTP_NOT_FOUND, ctype) |
446 res.status = '404 Not Found' |
446 return tmpl("notfound", repo=virtual) |
447 res.setbodygen(tmpl('notfound', repo=virtual)) |
447 |
448 return res.sendresponse() |
448 except ErrorResponse as err: |
449 |
449 wsgireq.respond(err, ctype) |
450 except ErrorResponse as e: |
450 return tmpl('error', error=err.message or '') |
451 res.status = statusmessage(e.code, pycompat.bytestr(e)) |
|
452 res.setbodygen(tmpl('error', error=e.message or '')) |
|
453 return res.sendresponse() |
451 finally: |
454 finally: |
452 tmpl = None |
455 tmpl = None |
453 |
456 |
454 def makeindex(self, req, res, tmpl, subdir=""): |
457 def makeindex(self, req, res, tmpl, subdir=""): |
455 self.refresh() |
458 self.refresh() |