diff options
author | Metalrom <romain.magny@gmail.com> | 2013-01-08 17:22:33 +0400 |
---|---|---|
committer | Metalrom <romain.magny@gmail.com> | 2013-01-10 17:20:03 +0400 |
commit | f493cec11c03fdc185b73965c5d586350b9ebf38 (patch) | |
tree | 345bdbe6fc5546560cc78645cea759f3e8c6a966 /LibGit2Sharp/InvalidSpecificationException.cs | |
parent | 191bd74c933427a377a5eb2ffeb4a0f39a26ceb0 (diff) |
Add InvalidSpecificationException as wrapper for EINVALIDSPEC native exception
Diffstat (limited to 'LibGit2Sharp/InvalidSpecificationException.cs')
-rw-r--r-- | LibGit2Sharp/InvalidSpecificationException.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/LibGit2Sharp/InvalidSpecificationException.cs b/LibGit2Sharp/InvalidSpecificationException.cs new file mode 100644 index 00000000..3d497b73 --- /dev/null +++ b/LibGit2Sharp/InvalidSpecificationException.cs @@ -0,0 +1,54 @@ +using System; +using System.Runtime.Serialization; +using LibGit2Sharp.Core; + +namespace LibGit2Sharp +{ + /// <summary> + /// The exception that is thrown when the provided specification is syntactically incorrect. + /// </summary> + [Serializable] + public class InvalidSpecificationException : LibGit2SharpException + { + /// <summary> + /// Initializes a new instance of the <see cref = "InvalidSpecificationException" /> class. + /// </summary> + public InvalidSpecificationException() + { + } + + /// <summary> + /// Initializes a new instance of the <see cref = "InvalidSpecificationException" /> class with a specified error message. + /// </summary> + /// <param name = "message">A message that describes the error. </param> + public InvalidSpecificationException(string message) + : base(message) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref = "InvalidSpecificationException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception. + /// </summary> + /// <param name = "message">The error message that explains the reason for the exception. </param> + /// <param name = "innerException">The exception that is the cause of the current exception. If the <paramref name = "innerException" /> parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param> + public InvalidSpecificationException(string message, Exception innerException) + : base(message, innerException) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref = "InvalidSpecificationException" /> class with a serialized data. + /// </summary> + /// <param name = "info">The <see cref="SerializationInfo "/> that holds the serialized object data about the exception being thrown.</param> + /// <param name = "context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param> + protected InvalidSpecificationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + + internal InvalidSpecificationException(string message, GitErrorCode code, GitErrorCategory category) + : base(message, code, category) + { + } + } +} |