getFirstErrors(); $result = reset($errors); if (is_numeric($result)) { throw new Exception($result, \Yii::t('error', $result)); } else { throw new Exception(1003, $result); } } }