Skip to content

Commit 6c81931

Browse files
committed
trap an ugly stack, provide better error
1 parent 9cba6e6 commit 6c81931

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/datacustomcode/deploy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import json
1919
import os
2020
import shutil
21+
import sys
2122
import tempfile
2223
import time
2324
from typing import (
@@ -163,8 +164,12 @@ def prepare_dependency_archive(directory: str) -> None:
163164

164165
with tempfile.TemporaryDirectory() as temp_dir:
165166
logger.info("Building dependencies archive")
166-
shutil.copy("requirements.txt", temp_dir)
167-
shutil.copy("build_native_dependencies.sh", temp_dir)
167+
try:
168+
shutil.copy("requirements.txt", temp_dir)
169+
shutil.copy("build_native_dependencies.sh", temp_dir)
170+
except FileNotFoundError as e:
171+
logger.error(f"Error copying files: {e}")
172+
sys.exit(1)
168173
cmd = (
169174
f"{PLATFORM_ENV_VAR} docker run --rm "
170175
f"-v {temp_dir}:/workspace "

0 commit comments

Comments
 (0)