diff options
author | Metalrom <romain.magny@gmail.com> | 2013-01-07 18:52:18 +0400 |
---|---|---|
committer | Metalrom <romain.magny@gmail.com> | 2013-01-10 17:18:41 +0400 |
commit | d71f7561dd8ac5e7e6636f380a25d3fd1b4e5087 (patch) | |
tree | 1bf00462a13916aeb9829564d88f1e41e7a701a6 /LibGit2Sharp/NameConflictException.cs | |
parent | 0114a7c04ebe01c8c3b4cdcf9388d7212c6aba1e (diff) |
Add NameConflictException as wrapper for EEXIST native exception
Diffstat (limited to 'LibGit2Sharp/NameConflictException.cs')
-rw-r--r-- | LibGit2Sharp/NameConflictException.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/LibGit2Sharp/NameConflictException.cs b/LibGit2Sharp/NameConflictException.cs new file mode 100644 index 00000000..989256ca --- /dev/null +++ b/LibGit2Sharp/NameConflictException.cs @@ -0,0 +1,54 @@ +using System; +using System.Runtime.Serialization; +using LibGit2Sharp.Core; + +namespace LibGit2Sharp +{ + /// <summary> + /// The exception that is thrown when a reference, a remote, a submodule... with the same name already exists in the repository + /// </summary> + [Serializable] + public class NameConflictException : LibGit2SharpException + { + /// <summary> + /// Initializes a new instance of the <see cref = "NameConflictException" /> class. + /// </summary> + public NameConflictException() + { + } + + /// <summary> + /// Initializes a new instance of the <see cref = "NameConflictException" /> class with a specified error message. + /// </summary> + /// <param name = "message">A message that describes the error. </param> + public NameConflictException(string message) + : base(message) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref = "NameConflictException" /> 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 NameConflictException(string message, Exception innerException) + : base(message, innerException) + { + } + + /// <summary> + /// Initializes a new instance of the <see cref = "NameConflictException" /> 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 NameConflictException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + + internal NameConflictException(string message, GitErrorCode code, GitErrorCategory category) + : base(message, code, category) + { + } + } +} |