ensure error will always result in a failing HTTP status code
ensure error will always result in a failing HTTP status code

fixes #8326
proper fix for #7571 which did not work in all situations

yiisoft/yii2-framework,yiisoft/yii2-framework