Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe specific exceptions. #26

Open
fuzzball81 opened this issue Jul 30, 2018 · 1 comment
Open

Describe specific exceptions. #26

fuzzball81 opened this issue Jul 30, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@fuzzball81
Copy link
Member

Add git describe specific exceptions, extracting details for the failure from GitPython

Description

If there is a failure during a git describe operation a return code of 128 is always used and all the details are included in failure text. Instead of using a general exception, add a more specific describe exception and extract the failure text for GitPython and add it to the exception.

It may be a good idea to have several types of exceptions based on the common failure modes for more granular error handling but that can be another enhancement in the future.

@fuzzball81 fuzzball81 added the enhancement New feature or request label Jul 30, 2018
@jpichon
Copy link
Contributor

jpichon commented Jul 30, 2018

The specific failure message should already be available in the generic describe exception added with PR23 (sorry for the confusion!).

An issue with simply using the failure text to determine a specific exception is that the message comes from git and can be localised. For example, calling with a bad hash:

$ git describe kfoejoe
fatal: Not a valid object name kfoejoe
$ git describe ifihe
fatal: ifihe n'est pas un nom d'objet valide

So we may have to figure out what caused the most common errors by other means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants