Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine that caught LibGit2SharpException is the HTTP 401 error?

Tags:

libgit2sharp

When I try to fetch changes (RepositoryExtensions.Fetch) using invalid credentials LibGit2Sharp throws LibGit2SharpException with the following message:

An error was raised by libgit2. Category = Tag (Error).
Request failed with status code: 401

Since there might be other errors is there any way to determine that the exception is in fact HTTP 401 error without parsing the message?

like image 748
kolbasov Avatar asked Feb 19 '26 08:02

kolbasov


1 Answers

Unfortunately, I don't think it is currently possible to get more specific information from that exception. This is something that would be a useful addition. Would you want to open an issue on the LibGit2Sharp project for this? If not, I will create one shortly.

like image 133
jamill Avatar answered Feb 22 '26 02:02

jamill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!