From 4bf2140589c9ffedc46b9e36366afc16a6de43ed Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 24 Jan 2025 13:15:01 +0100 Subject: just-lock: Improve error handling for importing to Git --- bin/just-lock.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/just-lock.py') diff --git a/bin/just-lock.py b/bin/just-lock.py index a3650d0a..0d21bd26 100755 --- a/bin/just-lock.py +++ b/bin/just-lock.py @@ -416,7 +416,11 @@ def import_to_git(target: str, *, repo_type: str, content_id: str, fail_context=fail_context) # Get tree id of added directory - tree_id: str = get_tree_raw_id(target, repo_tmp_dir).hex() + try: + tree_id: str = get_tree_raw_id(target, repo_tmp_dir).hex() + except Exception as ex: + fail(fail_context + + "Writing tree to temporary repository failed with:\n%r" % (ex, )) # Commit the tree git_env = {**os.environ, **GIT_NOBODY_ENV} -- cgit v1.2.3