diff --git a/litellm/proxy/public_endpoints/public_endpoints.py b/litellm/proxy/public_endpoints/public_endpoints.py index f5bca53183..b2fb3dd0f8 100644 --- a/litellm/proxy/public_endpoints/public_endpoints.py +++ b/litellm/proxy/public_endpoints/public_endpoints.py @@ -4,6 +4,7 @@ from typing import List from fastapi import APIRouter, Depends, HTTPException +from litellm._logging import verbose_logger from litellm.litellm_core_utils.get_blog_posts import ( BlogPost, BlogPostsResponse, @@ -213,7 +214,10 @@ async def get_litellm_blog_posts(): """ try: posts_data = get_blog_posts() - except Exception: + except Exception as e: + verbose_logger.warning( + "LiteLLM: get_litellm_blog_posts endpoint fallback triggered: %s", str(e) + ) posts_data = GetBlogPosts.load_local_blog_posts() posts = [BlogPost(**p) for p in posts_data[:5]] diff --git a/tests/proxy_unit_tests/test_blog_posts_endpoint.py b/tests/proxy_unit_tests/test_blog_posts_endpoint.py index 1c5db4d2cf..0f93f6f80c 100644 --- a/tests/proxy_unit_tests/test_blog_posts_endpoint.py +++ b/tests/proxy_unit_tests/test_blog_posts_endpoint.py @@ -77,3 +77,4 @@ def test_get_blog_posts_returns_local_backup_on_failure(client): # Should not 500 — returns local backup assert response.status_code == 200 assert "posts" in response.json() + assert len(response.json()["posts"]) > 0