using System; using System.Runtime.Serialization; using LibGit2Sharp.Core; namespace LibGit2Sharp { /// /// The exception that is thrown when an error occurs during application execution. /// [Serializable] public class LibGit2SharpException : Exception { /// /// Initializes a new instance of the class. /// public LibGit2SharpException() { } /// /// Initializes a new instance of the class with a specified error message. /// /// A message that describes the error. public LibGit2SharpException(string message) : base(message) { } /// /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. public LibGit2SharpException(string message, Exception innerException) : base(message, innerException) { } /// /// Initializes a new instance of the class with a serialized data. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected LibGit2SharpException(SerializationInfo info, StreamingContext context) : base(info, context) { } internal LibGit2SharpException(string message, GitErrorCode code, GitErrorCategory category) : this(message) { Data.Add("libgit2.code", (int)code); Data.Add("libgit2.category", (int)category); } } }