/** * Classify outbound send errors for safe retries and actionable logs. * * Important: We only mark errors as retryable when we have an explicit HTTP * status code that indicates the message was not accepted (e.g. 429, 5xx). * For transport-level errors where delivery is ambiguous, we prefer to avoid * retries to reduce the chance of duplicate posts.
*/
export function classifyMSTeamsSendError(err: unknown): MSTeamsSendErrorClassification { const statusCode = extractStatusCode(err); const retryAfterMs = extractRetryAfterMs(err); const errorCode = extractErrorCode(err) ?? undefined;
/** * Detect whether an error is caused by a revoked Proxy. * * The Bot Framework SDK wraps TurnContext in a Proxy that is revoked once the * turn handler returns. Any later access (e.g. from a debounced callback) * throws a TypeError whose message contains the distinctive "proxy that has * been revoked" string.
*/
export function isRevokedProxyError(err: unknown): boolean { if (!(err instanceof TypeError)) { returnfalse;
} return /proxy that has been revoked/i.test(err.message);
}
export function formatMSTeamsSendErrorHint(
classification: MSTeamsSendErrorClassification,
): string | undefined { if (classification.kind === "auth") { return"check msteams appId/appPassword/tenantId (or env vars MSTEAMS_APP_ID/MSTEAMS_APP_PASSWORD/MSTEAMS_TENANT_ID)";
} if (classification.errorCode === "ContentStreamNotAllowed") { return"Teams expired the content stream; stop streaming earlier and fall back to normal message delivery";
} if (classification.kind === "throttled") { return"Teams throttled the bot; backing off may help";
} if (classification.kind === "transient") { return"transient Teams/Bot Framework error; retry may succeed";
} return undefined;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-05-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.