diff --git a/src/User/Service/PasswordRecoveryService.php b/src/User/Service/PasswordRecoveryService.php index 0e5b5978..a9e388ac 100644 --- a/src/User/Service/PasswordRecoveryService.php +++ b/src/User/Service/PasswordRecoveryService.php @@ -19,6 +19,7 @@ use Da\User\Traits\ModuleAwareTrait; use Exception; use Yii; +use yii\web\NotFoundHttpException; class PasswordRecoveryService implements ServiceInterface { @@ -50,7 +51,7 @@ public function run() $user = $this->query->whereEmail($this->email)->one(); if ($user === null) { - throw new \RuntimeException('User not found.'); + throw new NotFoundHttpException(Yii::t('usuario', 'User not found')); } $token = TokenFactory::makeRecoveryToken($user->id);