libgit2sharp - 如何判断捕获到的LibGit2SharpException是HTTP 401错误?

标签 libgit2sharp

当我尝试使用无效凭据获取更改 (RepositoryExtensions.Fetch) 时 LibGit2Sharp 抛出 LibGit2SharpException 并显示以下消息:

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

由于可能存在其他错误,有什么方法可以在不解析消息的情况下确定该异常实际上是 HTTP 401 错误?

最佳答案

不幸的是,我认为目前无法从该异常中获取更具体的信息。这是一个有用的补充。你想在 LibGit2Sharp project 上打开一个问题吗?为了这?如果没有,我会尽快创建一个。

关于libgit2sharp - 如何判断捕获到的LibGit2SharpException是HTTP 401错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21277283/

相关文章:

c# - 如何使用 libgit2sharp (git cat-file) 获取文件的头版本

c# - 如何使用 LibGit2Sharp 在 Git 上获取文件内容?

.net - 如何用 libgit2sharp 处理 'git add *'?

c# - 什么会导致 git pull(通过 libgit2sharp)出现 401 错误?

c# - 加载 git2.dll 时出现问题?

c# - 使用 libgit2sharp 从远程 (git show) 下载一个文件

c# - 使用 libgit2sharp 推送到 bitbucket

c# - Git 仓库内部格式解释

c# - 使用 LibGit2Sharp 暂存未跟踪文件时,Commands.Stage() 不会增加 Staged.Count

libgit2sharp - 标记为 'Deleted' 的文件在 LibGit2Sharp 中报告为 'Missing'