Skip to content

Commit 94dbd62

Browse files
committed
print tags error
1 parent cb4fe6e commit 94dbd62

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

databook_utils/insert_authors_version.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ class VersionNumber(Directive):
101101

102102
def run(self):
103103
try:
104-
latest_version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], encoding="utf8")
105-
except:
106-
raise EnvironmentError("There are no git tags from which to get the version number")
104+
latest_version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"],
105+
encoding="utf8",
106+
stderr=subprocess.STDOUT # capture stderr in the output
107+
)
108+
except subprocess.CalledProcessError as e:
109+
raise EnvironmentError(f"There are no git tags from which to get the version number.\n" f"error:\n{e.output}") from e
107110

108111
if self.arguments:
109112
paragraph_node = nodes.paragraph()

0 commit comments

Comments
 (0)