Skip to content

Commit

Permalink
Output url of file which failed to be fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed Apr 22, 2024
1 parent d43119b commit 7026568
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/mxdev/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from urllib import parse
from urllib import request
from urllib.error import URLError

import typing

Expand Down Expand Up @@ -125,16 +126,19 @@ def resolve_dependencies(
"it does not exist. Empty file assumed."
)
else:
with request.urlopen(file_or_url) as fio:
process_io(
fio,
requirements,
constraints,
package_keys,
override_keys,
ignore_keys,
variety,
)
try:
with request.urlopen(file_or_url) as fio:
process_io(
fio,
requirements,
constraints,
package_keys,
override_keys,
ignore_keys,
variety,
)
except URLError as e:
raise Exception(f"Failed to fetch '{file_or_url}': {e}")

if requirements and variety == "r":
requirements = (
Expand Down

0 comments on commit 7026568

Please sign in to comment.