This commit is contained in:
alorig
2025-11-10 00:13:11 +05:00
parent 46920aa313
commit 9fe6153c22
2 changed files with 71 additions and 5 deletions

View File

@@ -199,6 +199,13 @@ def generate_ideas_core(cluster_id: int, account_id: int = None, progress_callba
Returns:
Dict with 'success', 'idea_created', 'message', etc.
"""
import sys
print("=" * 80, flush=True, file=sys.stdout)
print("[GENERATE IDEAS CORE] Function started", flush=True, file=sys.stdout)
print(f"[GENERATE IDEAS CORE] cluster_id: {cluster_id}", flush=True, file=sys.stdout)
print(f"[GENERATE IDEAS CORE] account_id: {account_id}", flush=True, file=sys.stdout)
print("=" * 80, flush=True, file=sys.stdout)
tracker = ConsoleStepTracker('generate_ideas')
tracker.init("Task started")
@@ -279,7 +286,18 @@ def generate_ideas_core(cluster_id: int, account_id: int = None, progress_callba
}
except Exception as e:
tracker.error('Exception', str(e), e)
logger.error(f"Error in generate_ideas_core: {str(e)}", exc_info=True)
return {'success': False, 'error': str(e)}
import sys
import traceback
error_msg = str(e)
error_type = type(e).__name__
print("=" * 80, flush=True, file=sys.stdout)
print(f"[GENERATE IDEAS CORE] ERROR: {error_type}: {error_msg}", flush=True, file=sys.stdout)
print("[GENERATE IDEAS CORE] Full traceback:", flush=True, file=sys.stdout)
traceback.print_exc(file=sys.stdout)
print("=" * 80, flush=True, file=sys.stdout)
tracker.error('Exception', error_msg, e)
logger.error(f"Error in generate_ideas_core: {error_msg}", exc_info=True)
return {'success': False, 'error': error_msg, 'error_type': error_type}