Skip to content

Commit

Permalink
paquo.projects: catch if image provider cannot provide uri
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Aug 12, 2020
1 parent 6bda0df commit 8245184
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paquo/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ def add_image(self,
"""
# test if we may add:
img_uri = self._image_provider.uri(image_id)
if img_uri is None:
raise ValueError(f"image_provider can't provide URI for requested image_id: '{image_id}'")
img_id = self._image_provider.id(img_uri)
if not img_id == image_id:
_log.warning(f"image_provider roundtrip error: '{image_id}' -> uri -> '{img_id}'")
Expand Down

0 comments on commit 8245184

Please sign in to comment.