diff options
Diffstat (limited to 'talerbank/app/middleware.py')
-rw-r--r-- | talerbank/app/middleware.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/talerbank/app/middleware.py b/talerbank/app/middleware.py index 093ff20..eeb6a67 100644 --- a/talerbank/app/middleware.py +++ b/talerbank/app/middleware.py @@ -95,17 +95,18 @@ class ExceptionMiddleware: if so. Otherwise, it lets the native handler operate. """ LOGGER.error(f"Error: {exception}, while serving {request.get_full_path()}") + LOGGER.error(f"Stack trace: {traceback.format_exc()}") if hasattr(exception, "taler_error_code"): render_to = self.render.get(request.path) if not render_to: return JsonResponse( - {"ec": exception.taler_error_code, "error": exception.hint}, + {"code": exception.taler_error_code, "error": exception.hint}, status=exception.http_status_code, ) set_profile_hint(request, failure=True, success=False, hint=exception.hint) return redirect(render_to) else: - return JsonResponse(dict(hint="unexpected exception", exception=str(exception)), status=500) + return JsonResponse(dict(code=5300, hint="unexpected exception", exception=str(exception)), status=500) |