Skip to content

Commit

Permalink
fix: catch API errors for tags as well as whole image repos (#2945)
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Spagnuolo <[email protected]>
  • Loading branch information
dylanspag-lmco authored Nov 22, 2024
1 parent 40c9540 commit 12600fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion flytekit/image_spec/image_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ def exist(self) -> Optional[bool]:
if e.response.status_code == 404:
return False

if re.match(f"unknown: repository .*{self.name} not found", e.explanation):
if re.match(
f"unknown: (artifact|repository) .*{self.name}(|:{self.tag}) not found",
e.explanation,
):
click.secho(f"Received 500 error with explanation: {e.explanation}", fg="yellow")
return False

Expand Down

0 comments on commit 12600fc

Please sign in to comment.