aboutsummaryrefslogtreecommitdiff
path: root/app/class/Controlleruser.php
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2020-04-28 21:25:51 +0200
committern-peugnet <n.peugnet@free.fr>2020-04-28 21:25:51 +0200
commit1619c194a32c1496f9015a491f5fa9dff350d47e (patch)
treeeb88861b02820ee43104e822603293ebf23c58bb /app/class/Controlleruser.php
parent3ba521e5d60a05510aa97d826215b7660d3dcb59 (diff)
downloadwcms-1619c194a32c1496f9015a491f5fa9dff350d47e.tar.gz
wcms-1619c194a32c1496f9015a491f5fa9dff350d47e.zip
fix: never catch LogicExceptions except in index
Diffstat (limited to 'app/class/Controlleruser.php')
-rw-r--r--app/class/Controlleruser.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/class/Controlleruser.php b/app/class/Controlleruser.php
index 53cf9b9..0345434 100644
--- a/app/class/Controlleruser.php
+++ b/app/class/Controlleruser.php
@@ -2,8 +2,7 @@
namespace Wcms;
-use Exception;
-use Throwable;
+use RuntimeException;
class Controlleruser extends Controller
{
@@ -38,7 +37,7 @@ class Controlleruser extends Controller
$user = $this->usermanager->get($this->user);
try {
$user->hydrateexception($_POST);
- } catch (\Throwable $th) {
+ } catch (RuntimeException $th) {
Model::sendflashmessage('There was a problem when updating preference : ' . $th->getMessage(), 'error');
}
if ($_POST['passwordhash']) {
@@ -63,7 +62,7 @@ class Controlleruser extends Controller
$user = $usermanager->get($_POST['user']);
$user->addbookmark($bookmark);
$usermanager->add($user);
- } catch (Throwable $th) {
+ } catch (RuntimeException $th) {
Logger::errorex($th, true);
Model::sendflashmessage('Error while creating bookmark : ' . $th->getMessage(), 'error');
}