






















@@ -488,9 +488,10 @@ export type TelegramTransport = {
488488dispatcherAttempts?: TelegramDispatcherAttempt[];
489489/**
490490 * Promote this transport to its next fallback dispatcher before the next
491- * request. Returns false when no fallback path exists.
491+ * request. The original error, when available, is retained in diagnostics.
492+ * Returns false when no fallback path exists.
492493 */
493-forceFallback?: (reason: string) => boolean;
494+forceFallback?: (reason: string, err?: unknown) => boolean;
494495/**
495496 * Release all dispatchers owned by this transport and the TCP sockets they
496497 * hold. Safe to call multiple times; subsequent calls resolve immediately.
@@ -563,7 +564,8 @@ function createTelegramTransportAttempts(params: {
563564},
564565exportAttempt: { dispatcherPolicy: fallbackIpPolicy },
565566logLevel: "warn",
566-logMessage: "fetch fallback: DNS-resolved IP unreachable; trying alternative Telegram API IP",
567+logMessage:
568+"fetch fallback: primary connection path failed; trying alternative Telegram API IP",
567569});
568570569571return attempts;
@@ -864,8 +866,8 @@ export function resolveTelegramTransport(
864866fetch: resolvedFetch,
865867 sourceFetch,
866868dispatcherAttempts: transportAttempts.map((attempt) => attempt.exportAttempt),
867-forceFallback: (reason: string) =>
868-promoteStickyAttempt(stickyAttemptIndex + 1, new Error("forced fallback"), reason),
869+forceFallback: (reason: string, err?: unknown) =>
870+promoteStickyAttempt(stickyAttemptIndex + 1, err ?? new Error("forced fallback"), reason),
869871 close,
870872};
871873}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。