microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Apps/Events/ErrorEvent.cs
23lines · modecode
| 1 | using Microsoft.Teams.Api.Activities; |
| 2 | using Microsoft.Teams.Apps.Plugins; |
| 3 | |
| 4 | namespace Microsoft.Teams.Apps.Events; |
| 5 | |
| 6 | public class ErrorEvent : Event |
| 7 | { |
| 8 | public required Exception Exception { get; set; } |
| 9 | public IContext<IActivity>? Context { get; set; } |
| 10 | } |
| 11 | |
| 12 | public static partial class AppEventExtensions |
| 13 | { |
| 14 | public static App OnError(this App app, Action<IPlugin, ErrorEvent> handler) |
| 15 | { |
| 16 | return app.OnEvent(EventType.Error, handler); |
| 17 | } |
| 18 | |
| 19 | public static App OnError(this App app, Func<IPlugin, ErrorEvent, CancellationToken, Task> handler) |
| 20 | { |
| 21 | return app.OnEvent(EventType.Error, handler); |
| 22 | } |
| 23 | } |