Skip to content

Commit

Permalink
Fix file 404 traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Mar 19, 2024
1 parent d02533f commit 44d3e38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion indexer/src/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def get_file_path(self: str, channel: str, file_name: str) -> str:
Returns:
The file path
"""
return os.path.join(settings.files_dir, self.directory, channel, file_name)
file_path = os.path.join(settings.files_dir, self.directory, channel, file_name)
if not os.path.isfile(file_path):
raise FileNotFoundError("File not found, try a newer link!")
return file_path


indexes = {
Expand Down

0 comments on commit 44d3e38

Please sign in to comment.