Commit ffaba370 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Attrappage d'exception pour eviter warning dans la partie du code des applications

parent a7b3b409
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -161,17 +161,18 @@ class MailService {
        return $value;
    }

    /**
     * @throws NotFoundConfigException
     */
    public function sendMail($to, $subject, $texte, ?string $module = null, $attachement_path = null) : ?Mail
    {
        try {
            $fromEmail = $this->fetchValueFromConfig('from_email', $module);
            $fromName = $this->fetchValueFromConfig('from_name', $module);
            $doNotSend = $this->fetchValueFromConfig('do_not_send', $module);
            $redirect = $this->fetchValueFromConfig('redirect', $module);
            $redirectTo = $this->fetchValueFromConfig('redirect_to', $module);
            $subjectPrefix = $this->fetchValueFromConfig('subject_prefix', $module);
        } catch (NotFoundConfigException $e) {
            throw new RuntimeException("Un problème est survenu lors de la récupération de valeurs de config",0,$e);
        }

        if ($doNotSend === true)
        {