From 1f9e93a2c75ba3599f6ea98e7da4038ca4dea66a Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Thu, 27 Jun 2024 12:33:55 +0800 Subject: [PATCH] capture the stack trace properly --- backend/codegen/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/codegen/utils.py b/backend/codegen/utils.py index 9eeb4fd..caad0f7 100644 --- a/backend/codegen/utils.py +++ b/backend/codegen/utils.py @@ -13,7 +13,8 @@ def extract_html_content(text: str): print( "[HTML Extraction] No tags found in the generated content: " + text ) - sentry_sdk.capture_exception( - Exception(" No tags found in the generated content") - ) + try: + raise Exception("No tags found in the generated content") + except: + sentry_sdk.capture_exception() return text