Skip to content

Commit 502d01f

Browse files
committed
fix: Correct the import
1 parent aa50bb4 commit 502d01f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/frformat/get_values_script.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import csv
22
import io
33
import os
4+
from socket import timeout
45
import urllib.parse
56
import urllib.request
67

@@ -16,9 +17,12 @@ def get_valid_values(path: str, column: str) -> frozenset[str]:
1617
try:
1718
response = urllib.request.urlopen(path)
1819
csvfile = io.StringIO(response.read().decode("utf-8"))
19-
except Exception as e:
20-
raise ValueError(f"Failed to fetch CSV from URL: {e} .")
21-
20+
except ConnectionResetError:
21+
print("==> ConnectionResetError")
22+
pass
23+
except timeout:
24+
print("==> Timeout")
25+
pass
2226
elif os.path.isfile(path):
2327
splitted_path = path.split(".")
2428
if splitted_path[len(splitted_path) - 1] == "csv":

0 commit comments

Comments
 (0)