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:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user