libgit2sharp
libgit2sharp copied to clipboard
Most exceptions have the same type of LibGit2SharpException
Most exceptions have the same type of LibGit2SharpException, which makes it difficult to filter specific exceptions and throw our own exception with some custom message. One example is below:
Reproduction steps
When we provide incorrect credentials, it gives an error message "Too many authentication replays" with an exception type of LibGit2SharpException. Because of this, we cannot identify exception based on its type and provide a more user friendly exception.
Version of LibGit2Sharp (release number or SHA1)
0.27.0-preview-0158
Operating system(s) tested; .NET runtime tested
OS: Windows 10 .NET runtime: .NET 6.0
In this particular example, you should return an error from your credential handler. You're seeing the "last chance" error message when libgit2 had prevented infinite loops of credential failures.