comparison mercurial/hgweb/hgweb_mod.py @ 45682:d2e1dcd4490d

errors: name arguments to Abort constructor Differential Revision: https://phab.mercurial-scm.org/D9179
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 08 Oct 2020 13:37:31 -0700
parents 4aa484efc926
children 89a2afe31e82
comparison
equal deleted inserted replaced
45681:a736ab681b78 45682:d2e1dcd4490d
491 res.headers[b'Content-Type'] = ctype 491 res.headers[b'Content-Type'] = ctype
492 return rctx.sendtemplate(b'error', error=pycompat.bytestr(e)) 492 return rctx.sendtemplate(b'error', error=pycompat.bytestr(e))
493 except error.Abort as e: 493 except error.Abort as e:
494 res.status = b'403 Forbidden' 494 res.status = b'403 Forbidden'
495 res.headers[b'Content-Type'] = ctype 495 res.headers[b'Content-Type'] = ctype
496 return rctx.sendtemplate(b'error', error=pycompat.bytestr(e)) 496 return rctx.sendtemplate(b'error', error=e.message)
497 except ErrorResponse as e: 497 except ErrorResponse as e:
498 for k, v in e.headers: 498 for k, v in e.headers:
499 res.headers[k] = v 499 res.headers[k] = v
500 res.status = statusmessage(e.code, pycompat.bytestr(e)) 500 res.status = statusmessage(e.code, pycompat.bytestr(e))
501 res.headers[b'Content-Type'] = ctype 501 res.headers[b'Content-Type'] = ctype