protected function throwInvalidModelException($model)
    {
        $errorMessage = Yii::t('language', 'Invalid model "{model}":', ['model' => $model->className()]);
        foreach ($model->getErrors() as $attribute => $errors) {
            $errorMessage .= "\n $attribute: " . join(', ', $errors);
        }
        throw new Exception($errorMessage);
    }