From 77626d28d1e0b70321c3cdf04f04d4d85c02efcd Mon Sep 17 00:00:00 2001 From: sabaimran Date: Tue, 7 May 2024 06:52:41 -0700 Subject: [PATCH] Include stack trace when automation is not successfully craeted --- src/khoj/routers/api.py | 2 +- src/khoj/routers/api_chat.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/khoj/routers/api.py b/src/khoj/routers/api.py index 70245f72..efda9841 100644 --- a/src/khoj/routers/api.py +++ b/src/khoj/routers/api.py @@ -459,7 +459,7 @@ async def post_automation( # Use the query to run as the scheduling request if the scheduling request is unset automation = await schedule_automation(query_to_run, subject, crontime, timezone, q, user, request.url) except Exception as e: - logger.error(f"Error creating automation {q} for {user.email}: {e}") + logger.error(f"Error creating automation {q} for {user.email}: {e}", exc_info=True) return Response( content=f"Unable to create automation. Ensure the automation doesn't already exist.", media_type="text/plain", diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index d97f0a81..3aadd2fa 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -756,7 +756,7 @@ async def chat( q, timezone, user, request.url, meta_log ) except Exception as e: - logger.error(f"Error creating automation {q} for {user.email}: {e}") + logger.error(f"Error creating automation {q} for {user.email}: {e}", exc_info=True) return Response( content=f"Unable to create automation. Ensure the automation doesn't already exist.", media_type="text/plain",