Skip to content

Commit

Permalink
fix(files_sharing): Do not wrap password policy exception into a gene…
Browse files Browse the repository at this point in the history
…ric one

Let the controller access the HintException and show the error to the user.

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Dec 10, 2024
1 parent 5af0d13 commit 900007d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private function splitFullId($id) {
* Verify if a password meets all requirements
*
* @param string $password
* @throws \Exception
* @throws HintException
*/
protected function verifyPassword($password) {
if ($password === null) {
Expand All @@ -112,11 +112,7 @@ protected function verifyPassword($password) {
}

// Let others verify the password
try {
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
} catch (HintException $e) {
throw new \Exception($e->getHint());
}
$this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
}

/**
Expand Down

0 comments on commit 900007d

Please sign in to comment.