I've a chatbot using Bot framework and I want to connect it to WhatsApp channel using the Infobip adapter and I'm getting 2 errors:
- A local or parameter named 'turnContext' cannot be declared in this scope because that name
2.A local or parameter named 'exception' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
public class InfobipWhatsAppAdapterWithErrorHandler: InfobipWhatsAppAdapter
{
public InfobipWhatsAppAdapterWithErrorHandler(InfobipWhatsAppAdapterOptions
infobipWhatsAppOptions, IInfobipWhatsAppClient infobipWhatsAppClient,
ILogger<InfobipWhatsAppAdapterWithErrorHandler> logger)
: base(infobipWhatsAppOptions, infobipWhatsAppClient, logger)
{
OnTurnError = async (turnContext, exception) =>
{
OnTurnError = async (turnContext, exception) =>
{
// Log any leaked exception from the application.
logger.LogError($"Exception caught : {exception.Message}");
// Send a catch-all apology to the user.
await turnContext.SendActivityAsync("Sorry, it looks like something went wrong.");
};
};
}
}
the error is on this line: OnTurnError = async (turnContext, exception) =>