From 6d93e22037d62d63355ff1b681df2ba9dfbc67a0 Mon Sep 17 00:00:00 2001 From: Elias Date: Thu, 20 Jun 2024 13:04:55 +0200 Subject: [PATCH] Catch stderr from subprocesses --- gitbark/cli/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitbark/cli/__main__.py b/gitbark/cli/__main__.py index ac8c0b7..6903774 100644 --- a/gitbark/cli/__main__.py +++ b/gitbark/cli/__main__.py @@ -46,6 +46,7 @@ import click import logging +import subprocess import sys import os @@ -327,6 +328,9 @@ def main(): if isinstance(e, CliFail): status = e.status msg = e.args[0] + elif isinstance(e, subprocess.CalledProcessError): + status = e.returncode + msg = e.stderr.strip() else: msg = "An unexpected error occured." formatter.show_trace = True