<#1145 fix: raise InvalidImageNameError for unknow...
# flyte-github
a
#1145 fix: raise InvalidImageNameError for unknown image ref in deploy Pull request opened by EngHabu Summary When a user references an image name in a
TaskEnvironment
that isn't declared in their config,
_build_images
raised a bare
ValueError
. During
flyte deploy
/
flyte run
this is captured and leaks into Sentry as if it were an SDK crash (FLYTE-SDK-4C), even though it's a user-config mistake. This swaps the bare
ValueError
for the purpose-built
InvalidImageNameError
(a
RuntimeUserError
subclass that already exists in
flyte/errors.py
). It is already filtered by
flyte/_sentry.py:_is_user_error
, so it stops polluting Sentry, and it gives the user a clearly-typed, actionable error.
Copy code
ValueError: Image name 'usda-firecon' not found in config. Available: ['solution_image']
The message is preserved verbatim; only the exception type changes. Closes • FLYTE-SDK-4C —
ValueError: Image name '...' not found in config
from
flyte._deploy in _build_images
.
fixes FLYTE-SDK-4C
Test plan •
tests/cli/test_run.py::test_build_images_image_name_not_found_error
updated to assert
InvalidImageNameError
(message assertions unchanged) — passes. •
make fmt
clean. 🤖 Generated with Claude Code flyteorg/flyte-sdk