Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented code to post error as reply to user #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions samples/msgext-doc-search-csharp/AdapterWithErrorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public AdapterWithErrorHandler(BotFrameworkAuthentication auth, ILogger<IBotFram
// to add telemetry capture to your bot.
logger.LogError(exception, $"[OnTurnError] unhandled error : {exception.Message}");

// Send a message to the user
await turnContext.SendActivityAsync("The bot encountered an error or bug.");
await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await turnContext.SendActivityAsync("The bot encountered an error or bug.");
// await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");

// Send a trace activity, which will be displayed in the Bot Framework Emulator
await turnContext.TraceActivityAsync("OnTurnError Trace", exception.Message, "https://www.botframework.com/schemas/error", "TurnError");
Expand Down
6 changes: 3 additions & 3 deletions samples/msgext-doc-search-js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ adapter.onTurnError = async (context, error) => {
// configuration instructions.
console.error(`\n [onTurnError] unhandled error: ${error}`);

// Send a message to the user
await context.sendActivity(`The bot encountered an unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await context.sendActivity(`The bot encountered an unhandled error:\n ${error.message}`);
// await context.sendActivity("To continue to run this bot, please fix the bot source code.");
};

// Create the bot that will handle incoming messages.
Expand Down
6 changes: 3 additions & 3 deletions samples/msgext-multiparam-csharp/AdapterWithErrorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public AdapterWithErrorHandler(BotFrameworkAuthentication auth, ILogger<IBotFram
// to add telemetry capture to your bot.
logger.LogError(exception, $"[OnTurnError] unhandled error : {exception.Message}");

// Send a message to the user
await turnContext.SendActivityAsync("The bot encountered an error or bug.");
await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await turnContext.SendActivityAsync("The bot encountered an error or bug.");
// await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");

// Send a trace activity, which will be displayed in the Bot Framework Emulator
await turnContext.TraceActivityAsync("OnTurnError Trace", exception.Message, "https://www.botframework.com/schemas/error", "TurnError");
Expand Down
6 changes: 3 additions & 3 deletions samples/msgext-multiparam-js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ adapter.onTurnError = async (context, error) => {
// configuration instructions.
console.error(`\n [onTurnError] unhandled error: ${error}`);

// Send a message to the user
await context.sendActivity(`The bot encountered an unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await context.sendActivity(`The bot encountered an unhandled error:\n ${error.message}`);
// await context.sendActivity("To continue to run this bot, please fix the bot source code.");
};

// Create the bot that will handle incoming messages.
Expand Down
6 changes: 3 additions & 3 deletions samples/msgext-multiparam-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const onTurnErrorHandler = async (context: TurnContext, error: Error) => {
"TurnError"
);

// Send a message to the user
await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
// await context.sendActivity("To continue to run this bot, please fix the bot source code.");
};

// Set the onTurnError for the singleton CloudAdapter.
Expand Down
6 changes: 3 additions & 3 deletions samples/msgext-northwind-inventory-action-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const onTurnErrorHandler = async (context: TurnContext, error: Error) => {
"TurnError"
);

// Send a message to the user
await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
// await context.sendActivity("To continue to run this bot, please fix the bot source code.");
};

// Set the onTurnError for the singleton CloudAdapter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public AdapterWithErrorHandler(BotFrameworkAuthentication auth, ILogger<IBotFram
// Only send error message for user messages, not for other message types so the bot doesn't spam a channel or chat.
if (turnContext.Activity.Type == ActivityTypes.Message)
{
// Send a message to the user
await turnContext.SendActivityAsync("The bot encountered an error or bug.");
await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await turnContext.SendActivityAsync("The bot encountered an error or bug.");
// await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");

// Send a trace activity, which will be displayed in the Bot Framework Emulator
await turnContext.TraceActivityAsync("OnTurnError Trace", exception.Message, "https://www.botframework.com/schemas/error", "TurnError");
Expand Down
6 changes: 3 additions & 3 deletions samples/msgext-northwind-inventory-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const onTurnErrorHandler = async (context: TurnContext, error: Error) => {
"TurnError"
);

// Send a message to the user
await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
// await context.sendActivity("To continue to run this bot, please fix the bot source code.");
};

// Set the onTurnError for the singleton CloudAdapter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public AdapterWithErrorHandler(BotFrameworkAuthentication auth, ILogger<IBotFram
// to add telemetry capture to your bot.
logger.LogError(exception, $"[OnTurnError] unhandled error : {exception.Message}");

// Send a message to the user
await turnContext.SendActivityAsync("The bot encountered an error or bug.");
await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");
// Uncomment below commented line for local debugging.
// await turnContext.SendActivityAsync("The bot encountered an error or bug.");
// await turnContext.SendActivityAsync("To continue to run this bot, please fix the bot source code.");

// Send a trace activity, which will be displayed in the Bot Framework Emulator
await turnContext.TraceActivityAsync("OnTurnError Trace", exception.Message, "https://www.botframework.com/schemas/error", "TurnError");
Expand Down
14 changes: 7 additions & 7 deletions samples/msgext-product-support-sso-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ const onTurnErrorHandler = async (context: TurnContext, error: Error) => {
"TurnError"
);

// Send a message to the user
await context.sendActivity(
`The bot encountered unhandled error:\n ${error.message}`
);
await context.sendActivity(
"To continue to run this bot, please fix the bot source code."
);
// Uncomment below commented line for local debugging.
// await context.sendActivity(
// `The bot encountered unhandled error:\n ${error.message}`
// );
// await context.sendActivity(
// "To continue to run this bot, please fix the bot source code."
// );
};

// Set the onTurnError for the singleton CloudAdapter.
Expand Down