chore: cli better error handling
Deploy bin / deploy (push) Successful in 2s
Deploy, build and restart MASTER / deploy (push) Successful in 2s
Deploy agebd python package / deploy (push) Successful in 2s

This commit is contained in:
Benjamin Labrecque
2026-07-07 11:58:08 +02:00
parent 29b4f55e4f
commit fe2f7a5f91
+23 -11
View File
@@ -112,15 +112,27 @@ class ServiceCreator:
project_path = Path(SERVICE_DEST_DIR / service.dir_name).resolve()
logger.info(f"Generating uv.lock inside: {project_path}")
result = subprocess.run(
["uv", "lock"],
cwd=project_path, # Changes the working directory for the command
capture_output=True, # Captures stdout and stderr
text=True, # Returns strings instead of raw bytes
check=True, # Raises CalledProcessError if the exit code is non-zero
)
try:
result = subprocess.run(
["uv", "lock"],
cwd=project_path, # Changes the working directory for the command
capture_output=True, # Captures stdout and stderr
text=True, # Returns strings instead of raw bytes
check=True, # Raises CalledProcessError if the exit code is non-zero
)
logger.info("Success! uv.lock has been generated/updated.")
if result.stderr:
# uv prints its progress and resolution metrics to stderr
logger.warning(result.stderr.strip())
logger.info("Success! uv.lock has been generated/updated.")
if result.stderr:
# uv prints its progress and resolution metrics to stderr
logger.warning(result.stderr.strip())
except FileNotFoundError as e:
logger.error(
"The 'uv' command-line tool is not installed or not in your PATH.",
)
raise e
except subprocess.CalledProcessError as e:
logger.error("'uv lock' failed to execute successfully.")
logger.error(f"Exit Code: {e.returncode}")
logger.error(f"Details:\n{e.stderr}")
raise e