libgit2 / libgit2/libgit2sharp

Provide a machine-processable exception which is not based on strings

未關閉
#1,770 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C#
星號
3.5k
分支
925
PR 合併指標
30 天內沒有已合併 PR

描述

When using LibGit2Sharp with a remote repository, sometimes errors occur. Those are throw as LibGit2SharpException. At this point these exceptions can only be distinguished from each other by the exception message.
Is there a way to get certain server responses like a 404 as HTTPStatusCode and not have to extract it from the message? For example, if the URL is incorrect (server exists, but path is not valid), a LibGit2SharpException is thrown which returns "invalid url, missing path" as a message. Here a HTTPStatusCode inside the Exception would be better suited to distinguish between different server responses and to react accordingly.

Version of LibGit2Sharp (release number or SHA1)

V0.26

Operating system(s) tested; .NET runtime tested

Windows 10; .NET 4.6

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先追蹤遠端儲存庫操作收到伺服器錯誤時 LibGit2SharpException 的建立方式,尤其是 issue 中描述的無效 URL 範例。判斷如何在不依賴訊息的情況下公開可由機器處理的 HTTP 狀態,並為 404 回應和無效路徑回應新增覆蓋。完成的定義是呼叫端可以透過程式區分這些回應。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, git
領域
api
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。