Skip to content

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented May 1, 2025

What I am changing

  • Avoid panic when non-existent file is passed into TIFF.open

How I did it

  • Replace .unwrap() with .map_err(|err| PyFileNotFoundError::new_err(err.to_string()))?
  • Add unit test to ensure FileNotFoundError is raised for missing files

How you can test it

Related Issues

Fixes #90

let reader = store.into_async_file_reader(path);

let cog_reader = future_into_py(py, async move {
let metadata_fetch = PrefetchBuffer::new(reader.clone(), prefetch).await.unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should remove all of these unwraps, but we can leave that for the future.

@weiji14 weiji14 marked this pull request as ready for review May 6, 2025 22:20
@weiji14 weiji14 merged commit 58fcf88 into main May 6, 2025
6 checks passed
@weiji14 weiji14 deleted the raise_filenotfounderror branch May 6, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raise NotFoundError rather than panic on non-existent file
2 participants