[web] Fix UnboundLocalError about "exc" in ajax controller 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 06 Feb 2018 16:31:49 +0100
branch3.26
changeset 12263 e9dd37ffa076
parent 12262 282bc6fb50fd
child 12264 cc83524263a9
[web] Fix UnboundLocalError about "exc" in ajax controller Introduced in 159dce89a145.
cubicweb/web/views/ajaxcontroller.py
--- a/cubicweb/web/views/ajaxcontroller.py	Wed Feb 07 09:20:32 2018 +0100
+++ b/cubicweb/web/views/ajaxcontroller.py	Tue Feb 06 16:31:49 2018 +0100
@@ -153,7 +153,7 @@
             result = func(*args)
         except (RemoteCallFailed, DirectResponse):
             raise
-        except ValidationError:
+        except ValidationError as exc:
             raise RemoteCallFailed(exc_message(exc, self._cw.encoding),
                                    status=http_client.BAD_REQUEST)
         except Exception as exc: