Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions backend/api_gateway/routes/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from flask import jsonify, request, make_response
from flask_restx import Resource, Namespace
import jwt
import traceback

# Import microservices and utilities
from backend.microservices.news_fetcher import fetch_news
Expand Down Expand Up @@ -71,7 +72,9 @@ def get(self):
}), 200)

except Exception as e:
logger.error(f"Error fetching news: {str(e)}")
# Capture the full stack trace
stack_trace = traceback.format_exc()
logger.error(f"Error fetching news: {str(e)}\nStack trace: {stack_trace}")
return make_response(jsonify({
'status': 'error',
'message': str(e)
Expand Down Expand Up @@ -133,7 +136,9 @@ def post(self):
}, 200

except Exception as e:
logger.error(f"Error processing articles: {str(e)}")
# Capture the full stack trace
stack_trace = traceback.format_exc()
logger.error(f"Error processing articles: {str(e)}\nStack trace: {stack_trace}")
return {
'status': 'error',
'message': str(e)
Expand Down
Loading