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 Nov 19, 2024
1 parent 6559c20 commit d0beeed
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 @@ -98,7 +98,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 @@ -111,11 +111,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 d0beeed

Please sign in to comment.