Skip to content

Commit 1436b68

Browse files
authored
Do not use LibGit2SharpException overload for unknown message
1 parent 50d6978 commit 1436b68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LibGit2Sharp/Core/Ensure.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private static unsafe void HandleError(int result)
148148
Func<string, GitErrorCategory, LibGit2SharpException> exceptionBuilder;
149149
if (!GitErrorsToLibGit2SharpExceptions.TryGetValue((GitErrorCode)result, out exceptionBuilder))
150150
{
151-
exceptionBuilder = (m, c) => new LibGit2SharpException(m, c);
151+
exceptionBuilder = (m, c) => new LibGit2SharpException($"{m}{(c == GitErrorCategory.Unknown ? string.Empty: $"\nGitErrorCode{c}")}");
152152
}
153153

154154
throw exceptionBuilder(errorMessage, errorCategory);

0 commit comments

Comments
 (0)