diff --git a/python_modules/dagster/dagster/_core/definitions/run_status_sensor_definition.py b/python_modules/dagster/dagster/_core/definitions/run_status_sensor_definition.py index 6a4ac5a6ee1d3..b360da94ba1d6 100644 --- a/python_modules/dagster/dagster/_core/definitions/run_status_sensor_definition.py +++ b/python_modules/dagster/dagster/_core/definitions/run_status_sensor_definition.py @@ -1102,7 +1102,7 @@ def inner( ) if jobs and monitor_all: - DagsterInvalidDefinitionError( + raise DagsterInvalidDefinitionError( f"Cannot specify both {'monitor_all_code_locations' if monitor_all_code_locations else 'monitor_all_repositories'} and" f" {'monitored_jobs' if monitored_jobs else 'job_selection'}." )