Commit ee4e212b authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Prise en compte des redirections pour éviter de traiter des faux positifs...

Prise en compte des redirections pour éviter de traiter des faux positifs d'erreurs 403 qui ont été bien traitées
parent b46196ae
Loading
Loading
Loading
Loading
+4 −2
Changes for src/UnicaenApp/Mouchard/MouchardListenerException.php: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@ class MouchardListenerException implements MouchardListenerInterface
    public function start()
    {
        if ($em = $this->getEventManager()) {
            $em->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'onMvcEvent']);
            $em->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'onMvcEvent']);
            $em->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'onMvcEvent'], -10000);
            $em->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'onMvcEvent'], -10000);
        }

        return $this;
@@ -61,11 +61,13 @@ class MouchardListenerException implements MouchardListenerInterface
        if ($sm = $this->getMouchard()) {
            $exception = $e->getResult()->exception;
            if ($exception) {
                if (!$e->getParam('redirected') === true){
                    $message = $this->makeMessage($exception);
                    $sm->envoyer($message);
                }
            }
        }
    }