We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6de8860 commit 63e9758Copy full SHA for 63e9758
src/gitingest/output_formatter.py
@@ -2,8 +2,10 @@
2
3
from __future__ import annotations
4
5
+import ssl
6
from typing import TYPE_CHECKING
7
8
+import requests.exceptions
9
import tiktoken
10
11
from gitingest.schemas import FileSystemNode, FileSystemNodeType
@@ -189,6 +191,9 @@ def _format_token_count(text: str) -> str | None:
189
191
except (ValueError, UnicodeEncodeError) as exc:
190
192
print(exc)
193
return None
194
+ except (requests.exceptions.RequestException, ssl.SSLError):
195
+ # If network errors, silently skip token count estimation instead of erroring out
196
+ return None
197
198
for threshold, suffix in _TOKEN_THRESHOLDS:
199
if total_tokens >= threshold:
0 commit comments