<#1148 fix: raise ImageBuildError for missing imag...
# flyte-github
a
#1148 fix: raise ImageBuildError for missing image source folder Pull request opened by EngHabu Problem
CopyConfig.validate()
raised a bare
ValueError
when an image's source path is missing or the wrong type (e.g. a stale
add_source(...)
path pointing at a build dir that no longer exists). That escaped into the SDK's Sentry project as an SDK crash, even though a bad source path is a user mistake in the image spec. Fix In
src/flyte/_image.py:CopyConfig.validate
, raise
flyte.errors.ImageBuildError
(a
RuntimeUserError
already filtered by
flyte/_sentry.py:_is_user_error
) for the three validation failures (missing path, not-a-directory, not-a-file). Messages are unchanged. No caller catches
ValueError
around this path (verified), and
ImageBuildError
is still a
RuntimeError
subclass. Closes • FLYTE-SDK-4D —
ValueError: Source folder /.../deploy/build/release/sandbox-server does not exist
.
fixes FLYTE-SDK-4D
Tests • Added
test_copy_config_validate_missing_src_raises_image_build_error
and
test_copy_config_validate_wrong_type_raises_image_build_error
. šŸ¤– Generated with Claude Code flyteorg/flyte-sdk