Skip to content

Commit

Permalink
fix: Improve error handling in ImageWriter for existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoadesScholar committed Dec 6, 2024
1 parent 103ffda commit d1d1529
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cellmap_data/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,10 @@ def array(self) -> xarray.DataArray:
try:
array = array_future.result()
except ValueError as e:
if "ALREADY_EXISTS" in str(e):
raise FileExistsError(
f"Image already exists at {self.path}. Set overwrite=True to overwrite the image."
)
Warning(e)
UserWarning("Falling back to zarr3 driver")
spec["driver"] = "zarr3"
Expand Down

0 comments on commit d1d1529

Please sign in to comment.