while: diagnose errors during condition evaluation

Add a policy to diagnose condition errors in a compatible way.

Fixes: #23296
15 files changed