From 36646417312ad0ac8a685e448b1d79deae42880b Mon Sep 17 00:00:00 2001 From: IonesioJunior Date: Thu, 24 Oct 2024 07:35:30 -0300 Subject: [PATCH] feat(syftbox/client/plugins/apps.py): Replace default app run error message by one which actually provides the error message so the user can understand what was the problem --- syftbox/client/plugins/apps.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/syftbox/client/plugins/apps.py b/syftbox/client/plugins/apps.py index 42130a5c..736b7115 100644 --- a/syftbox/client/plugins/apps.py +++ b/syftbox/client/plugins/apps.py @@ -51,8 +51,8 @@ def find_and_run_script(task_path, extra_args): # logger.info("✅ Script run.sh executed successfully.") return result - except Exception as e: - logger.info("Error running shell script", e) + except subprocess.CalledProcessError as e: + logger.info(f"Error running shell script: {str(e.stderr)}") else: raise FileNotFoundError(f"run.sh not found in {task_path}") @@ -190,8 +190,7 @@ def run_custom_app_config(client_config, app_config, path): logger.info(result.stdout) logger.error(result.stderr) except subprocess.CalledProcessError as e: - logger.error(f"Error running {app_name}: {e}") - logger.error(e.stderr) + logger.error(f"Error running {app_name}: {e.stderr}") if cron_iter is not None: # Schedule the next exection