<#1081 fix: raise InitializationError for missing ...
# flyte-github
a
#1081 fix: raise InitializationError for missing project/domain Pull request opened by EngHabu Summary
require_project_and_domain
raised a plain
ValueError
when
cfg.project
or
cfg.domain
was unset. The error message itself is already actionable (
"Project must be provided to initialize the client. Please set 'project' in the 'task' section of your config file, or pass it directly to flyte.init(project='your-project-name')."
), but
ValueError
is not in `_is_user_error`'s filter set, so every occurrence lands in Sentry as an unhandled SDK crash — purely user-config feedback being logged as if the SDK had bugged out. Switch both raises to
InitializationError("ProjectNotConfigured" / "DomainNotConfigured", "user", ...)
.
InitializationError
is already filtered from Sentry via
_is_user_error
(#1056), so this stops logging these as crashes while preserving the existing user-facing message verbatim. Sentry issues Fixes FLYTE-SDK-35 (
ValueError: Project must be provided to initialize the client.
) Test plan • New
test_require_project_and_domain_raises_initialization_error_when_project_missing
regression test • New
test_require_project_and_domain_raises_initialization_error_when_domain_missing
regression test • Existing
tests/user_api/test_initialize.py::TestDecorators
suite still passes (6/6) •
make fmt
clean 🤖 Generated with Claude Code flyteorg/flyte-sdk