Skip to content

Commit 6ae6779

Browse files
committed
more error logs
1 parent 672f0f9 commit 6ae6779

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/gitfetch/cli.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,19 @@ def main() -> int:
441441
return 0
442442

443443
except Exception as e:
444-
print(f"Error: {e}", file=sys.stderr)
444+
# When debugging, print full traceback to help diagnose issues
445+
# (useful when users report errors from package builds / other
446+
# environments where the short error message is not enough).
447+
try:
448+
import os
449+
import traceback
450+
if os.environ.get('GITFETCH_DEBUG'):
451+
traceback.print_exc()
452+
else:
453+
print(f"Error: {e}", file=sys.stderr)
454+
except Exception:
455+
# Fallback to simple message if traceback printing fails
456+
print(f"Error: {e}", file=sys.stderr)
445457
return 1
446458

447459
except KeyboardInterrupt:

0 commit comments

Comments
 (0)