Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzeXie committed Aug 25, 2021
1 parent d6e30df commit ac57577
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/python/tools/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def download_file(url, output_dir):
The path to the downloaded files.
Raises:
OSError: An error occurred when downloading is failed.
RuntimeError: An error occurred when downloading is failed.
"""
output_dir = Path(output_dir)
if not output_dir.exists():
Expand All @@ -688,7 +688,7 @@ def download_file(url, output_dir):
print(f"Downloading {filename} to {filepath}")
urlretrieve(url, str(filepath))
except OSError:
raise OSError(f"Failed to download {filename}")
raise RuntimeError(f"Failed to download {filename}")

return filepath

Expand Down Expand Up @@ -749,7 +749,7 @@ def extract_file(filepath):
except:
raise RuntimeError("Undefined exception.")
except EOFError:
raise EOFError("Dataset file isn't complete. Try download again.")
raise RuntimeError("Dataset file isn't complete. Try download again.")

if filepath.exists():
filepath.unlink()
Expand Down

0 comments on commit ac57577

Please sign in to comment.