This fixes a Python 3 bug where hgweb assumes an Exception
subclass will have a .message attribute after running
Exception.__init__.[1] The Python 3 way to get this info would
be e.args[0], but adding a new named attribute is more
ergonomic in my view.
Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG8d9322b6e687: hgweb: add a `message` attribute to `hgweb.common.ErrorResponse`
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
The error I mentioned looks like this:
Traceback (most recent call last): File "/var/hg/venv_hgweb/lib64/python3.6/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 358, in run_wsgi for r in self._runwsgi(req, res): File "/var/hg/venv_hgweb/lib64/python3.6/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 463, in _runwsgi res.setbodygen(tmpl.generate('error', {'error': e.message or ''})) AttributeError: 'ErrorResponse' object has no attribute 'message'