Skip to content
Open
Show file tree
Hide file tree
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: 6 additions & 3 deletions server/worldmonitor/intelligence/v1/classify-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Return: {"level":"...","category":"..."}`;
let parsed: { level?: string; category?: string };
try {
parsed = JSON.parse(raw);
} catch {
} catch (error) {
console.warn('[classify-event] JSON.parse of LLM response failed', error);
return null;
}

Expand All @@ -98,12 +99,14 @@ Return: {"level":"...","category":"..."}`;
if (!level || !category) return null;

return { level, category, timestamp: Date.now() };
} catch {
} catch (error) {
console.warn('[classify-event] classification fetch failed', error);
return null;
}
},
);
} catch {
} catch (error) {
console.warn('[classify-event] cached fetch failed', error);
markNoCacheResponse(ctx.request);
return { classification: undefined };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export async function getCountryIntelBrief(
try {
const url = new URL(ctx.request.url);
contextSnapshot = (url.searchParams.get('context') || '').trim().slice(0, 4000);
} catch {
} catch (error) {
console.warn('[get-country-intel-brief] context parse failed', error);
contextSnapshot = '';
}

Expand Down Expand Up @@ -102,11 +103,13 @@ Rules:
model: GROQ_MODEL,
generatedAt: Date.now(),
};
} catch {
} catch (error) {
console.warn('[get-country-intel-brief] GROQ brief generation failed', error);
return null;
}
});
} catch {
} catch (error) {
console.warn('[get-country-intel-brief] cached fetch failed', error);
return empty;
}

Expand Down
7 changes: 4 additions & 3 deletions server/worldmonitor/intelligence/v1/get-pizzint-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export async function getPizzintStatus(
locations,
};
}
} catch (_) { /* PizzINT unavailable — continue to GDELT */ }
} catch (error) { console.warn('[get-pizzint-status] PizzINT API fetch failed', error); }

// Fetch GDELT tension pairs
let tensionPairs: GdeltTensionPair[] = [];
Expand Down Expand Up @@ -146,14 +146,15 @@ export async function getPizzintStatus(
};
});
}
} catch { /* gdelt unavailable */ }
} catch (error) { console.warn('[get-pizzint-status] GDELT fetch failed', error); }
}

// Only cache if PizzINT data was retrieved
if (!pizzint) return null;
return { pizzint, tensionPairs };
});
} catch {
} catch (error) {
console.warn('[get-pizzint-status] cached fetch failed', error);
return { pizzint: undefined, tensionPairs: [] };
}

Expand Down
2 changes: 1 addition & 1 deletion server/worldmonitor/military/v1/list-military-bases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export async function listMilitaryBases(
const raw = metaMap.get(id);
if (!raw) continue;
let meta: Record<string, unknown>;
try { meta = JSON.parse(raw); } catch { continue; }
try { meta = JSON.parse(raw); } catch (error) { console.warn('[list-military-bases] JSON.parse failed', error); continue; }

const tier = (meta.tier as number) || 2;
if (zoom < 5 && tier > 1) continue;
Expand Down