Skip to content

Commit 03e488b

Browse files
raise errors properly on UnityRegistry (#4070)
* raise errors properly * Removin extra except * addressing comments
1 parent f6ff13a commit 03e488b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ml-agents-envs/mlagents_envs/registry/binary_utils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ def get_local_binary_path(name: str, url: str) -> str:
3838
break
3939
try:
4040
download_and_extract_zip(url, name)
41-
except IOError:
42-
logger.debug(
43-
f"Attempt {attempt + 1} / {NUMBER_ATTEMPTS} : Failed to download"
44-
)
41+
except Exception: # pylint: disable=W0702
42+
if attempt + 1 < NUMBER_ATTEMPTS:
43+
logger.warning(
44+
f"Attempt {attempt + 1} / {NUMBER_ATTEMPTS}"
45+
": Failed to download and extract binary."
46+
)
47+
else:
48+
raise
4549
path = get_local_binary_path_if_exists(name, url)
4650

4751
if path is None:

0 commit comments

Comments
 (0)