Skip to content

Commit c93d32d

Browse files
committed
from None
1 parent 44144e3 commit c93d32d

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

reflex/custom_components/custom_components.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def _collect_details_for_gallery():
698698
response.raise_for_status()
699699
except httpx.HTTPError as he:
700700
console.error(f"Unable to complete request due to {he}.")
701-
raise SystemExit(1) from he
701+
raise SystemExit(1) from None
702702

703703
files = []
704704
if (image_file_and_extension := _get_file_from_prompt_in_loop()) is not None:
@@ -733,7 +733,7 @@ def _collect_details_for_gallery():
733733

734734
except httpx.HTTPError as he:
735735
console.error(f"Unable to complete request due to {he}.")
736-
raise SystemExit(1) from he
736+
raise SystemExit(1) from None
737737

738738
console.info("Custom component information successfully shared!")
739739

@@ -769,7 +769,7 @@ def _get_file_from_prompt_in_loop() -> tuple[bytes, str] | None:
769769
image_file = image_file_path.read_bytes()
770770
except OSError as ose:
771771
console.error(f"Unable to read the {file_extension} file due to {ose}")
772-
raise SystemExit(1) from ose
772+
raise SystemExit(1) from None
773773
else:
774774
return image_file, file_extension
775775

reflex/utils/frontend_skeleton.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def initialize_requirements_txt() -> bool:
7070
except UnicodeDecodeError:
7171
continue
7272
except Exception as e:
73-
console.error(f"Failed to read {requirements_file_path}.")
74-
raise SystemExit(1) from e
73+
console.error(f"Failed to read {requirements_file_path} due to {e}.")
74+
raise SystemExit(1) from None
7575
else:
7676
return True
7777

reflex/utils/js_runtimes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ def validate_frontend_dependencies(init: bool = True):
325325
try:
326326
get_js_package_executor(raise_on_none=True)
327327
except FileNotFoundError as e:
328-
raise SystemExit(1) from e
328+
console.error(f"Failed to find a valid package manager due to {e}.")
329+
raise SystemExit(1) from None
329330

330331
if prefer_npm_over_bun() and not check_node_version():
331332
node_version = get_node_version()

reflex/utils/processes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_num_workers() -> int:
4949
redis_client.ping()
5050
except RedisError as re:
5151
console.error(f"Unable to connect to Redis: {re}")
52-
raise SystemExit(1) from re
52+
raise SystemExit(1) from None
5353
return (os.cpu_count() or 1) * 2 + 1
5454

5555

reflex/utils/templates.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def create_config_init_app_from_remote_template(app_name: str, template_url: str
125125
temp_dir = tempfile.mkdtemp()
126126
except OSError as ose:
127127
console.error(f"Failed to create temp directory for download: {ose}")
128-
raise SystemExit(1) from ose
128+
raise SystemExit(1) from None
129129

130130
# Use httpx GET with redirects to download the zip file.
131131
zip_file_path: Path = Path(temp_dir) / "template.zip"
@@ -136,28 +136,28 @@ def create_config_init_app_from_remote_template(app_name: str, template_url: str
136136
response.raise_for_status()
137137
except httpx.HTTPError as he:
138138
console.error(f"Failed to download the template: {he}")
139-
raise SystemExit(1) from he
139+
raise SystemExit(1) from None
140140
try:
141141
zip_file_path.write_bytes(response.content)
142142
console.debug(f"Downloaded the zip to {zip_file_path}")
143143
except OSError as ose:
144144
console.error(f"Unable to write the downloaded zip to disk {ose}")
145-
raise SystemExit(1) from ose
145+
raise SystemExit(1) from None
146146

147147
# Create a temp directory for the zip extraction.
148148
try:
149149
unzip_dir = Path(tempfile.mkdtemp())
150150
except OSError as ose:
151151
console.error(f"Failed to create temp directory for extracting zip: {ose}")
152-
raise SystemExit(1) from ose
152+
raise SystemExit(1) from None
153153

154154
try:
155155
zipfile.ZipFile(zip_file_path).extractall(path=unzip_dir)
156156
# The zip file downloaded from github looks like:
157157
# repo-name-branch/**/*, so we need to remove the top level directory.
158158
except Exception as uze:
159159
console.error(f"Failed to unzip the template: {uze}")
160-
raise SystemExit(1) from uze
160+
raise SystemExit(1) from None
161161

162162
if len(subdirs := list(unzip_dir.iterdir())) != 1:
163163
console.error(f"Expected one directory in the zip, found {subdirs}")

0 commit comments

Comments
 (0)