From 33793051bc6a544e058ac5267719d7ed282bdc0e Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Thu, 12 Sep 2024 15:04:39 +0200 Subject: [PATCH] temp log more with sentry --- backend/routes/generate_code.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py index 4133408..79a6a86 100644 --- a/backend/routes/generate_code.py +++ b/backend/routes/generate_code.py @@ -3,6 +3,7 @@ from dataclasses import dataclass import os from fastapi import APIRouter, WebSocket import openai +import sentry_sdk from codegen.utils import extract_html_content from config import ( IS_PROD, @@ -177,6 +178,17 @@ async def extract_params( await throw_error( "Please subscribe to a paid plan to generate code. If you are a subscriber and seeing this error, please contact support." ) + import sentry_sdk + + sentry_sdk.set_context( + "subscription_check", + { + "status": res.status, + "payment_method": payment_method, + "auth_token": auth_token, + }, + ) + sentry_sdk.capture_message("No payment method found") raise Exception("No payment method found") # Base URL for OpenAI API