Permalink
Browse files

Expose ErrorCode and ErrorCategory as readonly

  • Loading branch information...
1 parent 55ee014 commit 5e28e019310110405174c33f493325befb3d1167 @tclem committed Jun 21, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 LibGit2Sharp/LibGit2SharpException.cs
View
16 LibGit2Sharp/LibGit2SharpException.cs
@@ -82,6 +82,22 @@ public LibGit2SharpException(string message, Exception innerException)
{
}
+ /// <summary>
+ /// The specific libgit2 error code.
+ /// </summary>
+ public GitErrorCode Code
+ {
+ get { return Data.Contains("libgit2.code") ? (GitErrorCode)Data["libgit2.code"] : GitErrorCode.Error; }
+ }
+
+ /// <summary>
+ /// The specific libgit2 error class.
+ /// </summary>
+ public GitErrorCategory Category
+ {
+ get { return Data.Contains("libgit2.class") ? (GitErrorCategory)Data["libgit2.class"] : GitErrorCategory.Unknown; }
+ }
+
public override string ToString()
{
return isLibraryError

0 comments on commit 5e28e01

Please sign in to comment.