Skip to content

Commit 2882cc0

Browse files
committed
fix: add warning log when network error
1 parent edaaa9e commit 2882cc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gitingest/output_formatter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ def _format_token_count(text: str) -> str | None:
194194
except (ValueError, UnicodeEncodeError) as exc:
195195
print(exc)
196196
return None
197-
except (requests.exceptions.RequestException, ssl.SSLError):
198-
# If network errors, silently skip token count estimation instead of erroring out
197+
except (requests.exceptions.RequestException, ssl.SSLError) as exc:
198+
# If network errors, skip token count estimation instead of erroring out
199+
print(f"Failed to download tiktoken model: {exc}")
199200
return None
200201

201202
for threshold, suffix in _TOKEN_THRESHOLDS:

0 commit comments

Comments
 (0)