// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.Teams.Core.Schema; namespace Microsoft.Teams.Core; /// /// Represents errors that occur during bot activity processing and provides context about the associated activity. /// /// Use this exception to capture and propagate errors that occur during bot activity handling, along /// with contextual information about the activity involved. This can aid in debugging and error reporting /// scenarios. public class BotHandlerException : Exception { /// /// Initializes a new instance of the class. /// public BotHandlerException() { } /// /// Initializes a new instance of the class with a specified error message. /// /// The error message that describes the reason for the exception. public BotHandlerException(string message) : base(message) { } /// /// Initializes a new instance of the class with a specified error message and inner exception. /// /// The error message that describes the reason for the exception. /// The underlying exception that caused this exception, or null if no inner exception is specified. public BotHandlerException(string message, Exception innerException) : base(message, innerException) { } /// /// Initializes a new instance of the class with a specified error message, inner exception, and activity. /// /// The error message that describes the reason for the exception. /// The underlying exception that caused this exception, or null if no inner exception is specified. /// The bot activity associated with the error. Cannot be null. public BotHandlerException(string message, Exception innerException, CoreActivity activity) : base(message, innerException) { Activity = activity; } /// /// Gets the bot activity associated with the exception, or null if no activity was provided. /// public CoreActivity? Activity { get; } }