Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Expose ErrorCode and ErrorCategory as readonly

  • Loading branch information...
commit 5e28e019310110405174c33f493325befb3d1167 1 parent 55ee014
Timothy Clem authored

Showing 1 changed file with 16 additions and 0 deletions. Show diff stats Hide diff stats

  1. +16 0 LibGit2Sharp/LibGit2SharpException.cs
16 LibGit2Sharp/LibGit2SharpException.cs
@@ -82,6 +82,22 @@ public LibGit2SharpException(string message, Exception innerException)
82 82 {
83 83 }
84 84
  85 + /// <summary>
  86 + /// The specific libgit2 error code.
  87 + /// </summary>
  88 + public GitErrorCode Code
  89 + {
  90 + get { return Data.Contains("libgit2.code") ? (GitErrorCode)Data["libgit2.code"] : GitErrorCode.Error; }
  91 + }
  92 +
  93 + /// <summary>
  94 + /// The specific libgit2 error class.
  95 + /// </summary>
  96 + public GitErrorCategory Category
  97 + {
  98 + get { return Data.Contains("libgit2.class") ? (GitErrorCategory)Data["libgit2.class"] : GitErrorCategory.Unknown; }
  99 + }
  100 +
85 101 public override string ToString()
86 102 {
87 103 return isLibraryError

0 comments on commit 5e28e01

Please sign in to comment.
Something went wrong with that request. Please try again.