From 1b2993b9a14b4226b90bb307a0f18a8adaaaa3de Mon Sep 17 00:00:00 2001 From: andersonid Date: Mon, 6 Oct 2025 10:48:16 -0300 Subject: [PATCH] fix: add exception_type to Celery task error handling --- app/tasks/cluster_analysis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/tasks/cluster_analysis.py b/app/tasks/cluster_analysis.py index 26eeb84..7cf5017 100644 --- a/app/tasks/cluster_analysis.py +++ b/app/tasks/cluster_analysis.py @@ -99,7 +99,7 @@ def analyze_cluster(self, cluster_config=None): logger.error(f"Cluster analysis failed: {str(exc)}") self.update_state( state='FAILURE', - meta={'error': str(exc), 'status': 'Analysis failed'} + meta={'error': str(exc), 'status': 'Analysis failed', 'exception_type': type(exc).__name__} ) raise exc @@ -184,6 +184,6 @@ def analyze_namespace(self, namespace): logger.error(f"Namespace {namespace} analysis failed: {str(exc)}") self.update_state( state='FAILURE', - meta={'error': str(exc), 'status': f'Namespace {namespace} analysis failed'} + meta={'error': str(exc), 'status': f'Namespace {namespace} analysis failed', 'exception_type': type(exc).__name__} ) raise exc