Skip to content

Commit

Permalink
Island: Add TODO about IFileRepository FileNotFoundErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
mssalvatore committed Jun 8, 2022
1 parent 729497c commit 1b2ca74
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def open_file(self, unsafe_file_name: str) -> BinaryIO:
logger.debug(f"Opening {safe_file_path}")
return open(safe_file_path, "rb")
except OSError as err:
# TODO: The interface should make a destinction between file not found and an error when
# retrieving a file that should exist. The built-in `FileNotFoundError` is not
# sufficient because it inherits from `OSError` and the interface does not
# guarantee that the file is stored on the local file system.
raise FileRetrievalError(f"Failed to retrieve file {safe_file_path}: {err}") from err

def delete_file(self, unsafe_file_name: str):
Expand Down

0 comments on commit 1b2ca74

Please sign in to comment.