microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.1.0-preview-0006

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Apps/Events/ErrorEvent.cs

26lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Api.Activities;
5using Microsoft.Teams.Apps.Plugins;
6
7namespace Microsoft.Teams.Apps.Events;
8
9public class ErrorEvent : Event
10{
11 public required Exception Exception { get; set; }
12 public IContext<IActivity>? Context { get; set; }
13}
14
15public static partial class AppEventExtensions
16{
17 public static App OnError(this App app, Action<IPlugin, ErrorEvent> handler)
18 {
19 return app.OnEvent(EventType.Error, handler);
20 }
21
22 public static App OnError(this App app, Func<IPlugin, ErrorEvent, CancellationToken, Task> handler)
23 {
24 return app.OnEvent(EventType.Error, handler);
25 }
26}