forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from UiPath/fix/exception_error_code
fix confusion between exception ctor(format, params args) and ctor(message, code, category)
- Loading branch information
Showing
6 changed files
with
38 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace LibGit2Sharp.Tests; | ||
public class ExceptionTests | ||
{ | ||
[Fact] | ||
public void When_CreatingException_Given_ItHasErrorCode_Then_ErrorCodeIsSet() | ||
{ | ||
var instance = new LibGit2SharpException("message").WithErrorCode(Core.GitErrorCode.Certificate, Core.GitErrorCategory.Ssh); | ||
Assert.Equal(Core.GitErrorCategory.Ssh, instance.GitErrorCategory); | ||
Assert.Equal(Core.GitErrorCode.Certificate, instance.GitErrorCode); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ public enum GitErrorCategory | |
Worktree, | ||
Sha1, | ||
Http, | ||
Internal | ||
Internal, | ||
GraphTS | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters