Skip to content

Commit

Permalink
add error handling to get_file_size
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Nov 12, 2023
1 parent 34de288 commit a02c7c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/preprocess/AssetProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ def get_file_size(self, local_path_exists: bool, path: str) -> int:
"""
if not local_path_exists:
return None
try:
size = os.path.getsize(path)
return size
except FileNotFoundError:
print(" Warning: Could not get file size of " + path)
return 0

return os.path.getsize(path)

def get_filename_with_hash(self, path: str, is_remote: bool) -> str:
# local path
Expand Down

0 comments on commit a02c7c8

Please sign in to comment.