fix: Provide detailed error for story fetch failures

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-11-21 00:50:58 +00:00
parent aa80570da4
commit f2310b6925

View File

@@ -39,7 +39,9 @@ function Feed({ updateCache }) {
const storyRes = await fetch('/api/' + newStory.id, { signal: controller.signal }); const storyRes = await fetch('/api/' + newStory.id, { signal: controller.signal });
clearTimeout(timeoutId); clearTimeout(timeoutId);
if (!storyRes.ok) throw new Error('Story fetch failed'); if (!storyRes.ok) {
throw new Error(`Server responded with ${storyRes.status} ${storyRes.statusText}`);
}
const storyResult = await storyRes.json(); const storyResult = await storyRes.json();
const fullStory = storyResult.story; const fullStory = storyResult.story;