libgit2 / libgit2/libgit2sharp
Provide a machine-processable exception which is not based on strings
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how LibGit2SharpException is created when remote repository operations receive server errors, especially the invalid-URL example described in the issue. Determine how a machine-processable HTTP status could be exposed without relying on the message, and add coverage for 404 and invalid-path responses. Done means callers can distinguish these responses programmatically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100