summaryrefslogtreecommitdiffstats
path: root/core/Command/User/ResetPassword.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/User/ResetPassword.php')
-rw-r--r--core/Command/User/ResetPassword.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php
index cf8c894d7a7..62c4eceeee2 100644
--- a/core/Command/User/ResetPassword.php
+++ b/core/Command/User/ResetPassword.php
@@ -113,7 +113,14 @@ class ResetPassword extends Command {
return 1;
}
- $success = $user->setPassword($password);
+
+ try {
+ $success = $user->setPassword($password);
+ } catch (\Exception $e) {
+ $output->writeln('<error>' . $e->getMessage() . '</error>');
+ return 1;
+ }
+
if ($success) {
$output->writeln("<info>Successfully reset password for " . $username . "</info>");
} else {