microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.0.8

Branches

Tags

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

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Core/BotHandlerException.cs

55lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Core.Schema;
5
6namespace Microsoft.Teams.Core;
7
8/// <summary>
9/// Represents errors that occur during bot activity processing and provides context about the associated activity.
10/// </summary>
11/// <remarks>Use this exception to capture and propagate errors that occur during bot activity handling, along
12/// with contextual information about the activity involved. This can aid in debugging and error reporting
13/// scenarios.</remarks>
14public class BotHandlerException : Exception
15{
16 /// <summary>
17 /// Initializes a new instance of the <see cref="BotHandlerException"/> class.
18 /// </summary>
19 public BotHandlerException()
20 {
21 }
22
23 /// <summary>
24 /// Initializes a new instance of the <see cref="BotHandlerException"/> class with a specified error message.
25 /// </summary>
26 /// <param name="message">The error message that describes the reason for the exception.</param>
27 public BotHandlerException(string message) : base(message)
28 {
29 }
30
31 /// <summary>
32 /// Initializes a new instance of the <see cref="BotHandlerException"/> class with a specified error message and inner exception.
33 /// </summary>
34 /// <param name="message">The error message that describes the reason for the exception.</param>
35 /// <param name="innerException">The underlying exception that caused this exception, or null if no inner exception is specified.</param>
36 public BotHandlerException(string message, Exception innerException) : base(message, innerException)
37 {
38 }
39
40 /// <summary>
41 /// Initializes a new instance of the <see cref="BotHandlerException"/> class with a specified error message, inner exception, and activity.
42 /// </summary>
43 /// <param name="message">The error message that describes the reason for the exception.</param>
44 /// <param name="innerException">The underlying exception that caused this exception, or null if no inner exception is specified.</param>
45 /// <param name="activity">The bot activity associated with the error. Cannot be null.</param>
46 public BotHandlerException(string message, Exception innerException, CoreActivity activity) : base(message, innerException)
47 {
48 Activity = activity;
49 }
50
51 /// <summary>
52 /// Gets the bot activity associated with the exception, or null if no activity was provided.
53 /// </summary>
54 public CoreActivity? Activity { get; }
55}
56