Skip to content

Commit 7026568

Browse files
committed
Output url of file which failed to be fetched
1 parent d43119b commit 7026568

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/mxdev/processing.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66
from urllib import parse
77
from urllib import request
8+
from urllib.error import URLError
89

910
import typing
1011

@@ -125,16 +126,19 @@ def resolve_dependencies(
125126
"it does not exist. Empty file assumed."
126127
)
127128
else:
128-
with request.urlopen(file_or_url) as fio:
129-
process_io(
130-
fio,
131-
requirements,
132-
constraints,
133-
package_keys,
134-
override_keys,
135-
ignore_keys,
136-
variety,
137-
)
129+
try:
130+
with request.urlopen(file_or_url) as fio:
131+
process_io(
132+
fio,
133+
requirements,
134+
constraints,
135+
package_keys,
136+
override_keys,
137+
ignore_keys,
138+
variety,
139+
)
140+
except URLError as e:
141+
raise Exception(f"Failed to fetch '{file_or_url}': {e}")
138142

139143
if requirements and variety == "r":
140144
requirements = (

0 commit comments

Comments
 (0)