fix(zero): defensive fetch — don't crash Server Components on engine errors
- autogen page.js: wrap engineCall in try/catch (return null on any failure) - /zero page: use Promise.allSettled so one failed source doesn't break page Root cause was ENGINE_URL=host.docker.internal not resolving in coolify net, fixed at env level but defending code too so future quirks degrade gracefully.
This commit is contained in:
+4
-1
@@ -11,10 +11,13 @@ export const metadata = {
|
||||
};
|
||||
|
||||
export default async function ZeroPage() {
|
||||
const [notes, character] = await Promise.all([
|
||||
// defensive: один битый источник не должен валить страницу
|
||||
const results = await Promise.allSettled([
|
||||
listZeroNotes({ limit: 100 }),
|
||||
getZeroCharacter(),
|
||||
]);
|
||||
const notes = results[0].status === 'fulfilled' ? results[0].value : [];
|
||||
const character = results[1].status === 'fulfilled' ? results[1].value : null;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user