@microsoft/teamsfx 2.3.1-beta.2024012303.0 → 2.3.1-rc-hotfix.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5184,11 +5184,14 @@ class ConversationBot {
5184
5184
  adapter.onTurnError = (context, error) => __awaiter(this, void 0, void 0, function* () {
5185
5185
  // This check writes out errors to console.
5186
5186
  console.error(`[onTurnError] unhandled error`, error);
5187
- // Send a trace activity, which will be displayed in Bot Framework Emulator
5188
- yield context.sendTraceActivity("OnTurnError Trace", error instanceof Error ? error.message : error, "https://www.botframework.com/schemas/error", "TurnError");
5189
- // Send a message to the user
5190
- yield context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
5191
- yield context.sendActivity("To continue to run this bot, please fix the bot source code.");
5187
+ // Only send error message for user messages, not for other message types so the bot doesn't spam a channel or chat.
5188
+ if (context.activity.type === "message") {
5189
+ // Send a trace activity, which will be displayed in Bot Framework Emulator
5190
+ yield context.sendTraceActivity("OnTurnError Trace", error instanceof Error ? error.message : error, "https://www.botframework.com/schemas/error", "TurnError");
5191
+ // Send a message to the user
5192
+ yield context.sendActivity(`The bot encountered unhandled error: ${error.message}`);
5193
+ yield context.sendActivity("To continue to run this bot, please fix the bot source code.");
5194
+ }
5192
5195
  });
5193
5196
  return adapter;
5194
5197
  }