fix(web): surface media fetch failures

This commit is contained in:
Peter Steinberger committed 2025-12-03 15:45:43 +00:00
1 parent 92a0763a74
commit a321bf1a90
4 files changed
+65 -3

No files matched your search

+9 -1
View File
@@ -559,7 +559,15 @@ async function deliverWebReply(params: {
);
replyLogger.warn({ err, mediaUrl }, "failed to send web media reply");
if (index === 0) {
const fallbackText = remainingText.shift() ?? caption ?? "";
const warning =
err instanceof Error
? `⚠️ Media failed: ${err.message}`
: "⚠️ Media failed.";
const fallbackTextParts = [
remainingText.shift() ?? caption ?? "",
warning,
].filter(Boolean);
const fallbackText = fallbackTextParts.join("\n");
if (fallbackText) {
console.log(`⚠️ Media skipped; sent text-only to ${msg.from}`);
await msg.reply(fallbackText);