-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathZoomAdapterWithErrorHandler.cs
29 lines (27 loc) · 1.12 KB
/
ZoomAdapterWithErrorHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Bot.Builder.Community.Adapters.Zoom;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace Bot.Builder.Community.Samples.Zoom
{
public class ZoomAdapterWithErrorHandler : ZoomAdapter
{
public ZoomAdapterWithErrorHandler(IConfiguration configuration, ILogger<ZoomAdapter> logger)
: base(new ZoomAdapterOptions()
{
ValidateIncomingZoomRequests = false,
ClientId = configuration["ZoomClientId"],
ClientSecret = configuration["ZoomClientSecret"],
BotJid = configuration["ZoomBotJid"],
VerificationToken = configuration["ZoomVerificationToken"]
}, logger)
{
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.");
};
}
}
}