diff --git a/bottle.py b/bottle.py index 97a56d3e..b5a76e8f 100755 --- a/bottle.py +++ b/bottle.py @@ -1277,8 +1277,8 @@ def json(self): return None try: return json_loads(b) - except (ValueError, TypeError): - raise HTTPError(400, 'Invalid JSON') + except (ValueError, TypeError) as err: + raise HTTPError(400, 'Invalid JSON', exception=err) return None def _iter_body(self, read, bufsize): diff --git a/docs/changelog.rst b/docs/changelog.rst index df972d66..0688b1c4 100755 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,8 @@ Release 0.14 (in development) .. rubric:: Removed APIs (deprecated since 0.13) * Removed the ``RouteReset`` exception and associated logic. +* ``bottle.HTTPError``\s raised on Invalid JSON now include the underlying exception + in their ``exception`` field. Release 0.13 ==============