[fix] Correction d'exceptions non trappées (emails invalides, souscription vide)#144
Merged
Conversation
- SubscriptionService: throw new Error() instead of raw strings so the controller's catch (error:Error) block can trap them - Cron, VolunteerService: wrap addRecipient() calls in try/catch to skip invalid email addresses without aborting the whole task
dc52ca8 to
bac1c30
Compare
InterAMAP44
approved these changes
Jun 20, 2026
Mandrak-Kimigo
added a commit
that referenced
this pull request
Jun 21, 2026
Mise en production de la version 3.0.7. ## Changements depuis v3.0.6 - [mantis-276] Export CSV des souscriptions sur la page Catalogues (#141) - Fix exceptions non gérées sur emails invalides et commandes manquantes (#144) - TYPE_CONSTORDERS : suppression d'une participation autorisée uniquement si aucune distribution passée (70f9c80) - TYPE_CONSTORDERS : message d'erreur spécifique dans cancelParticipation (9510691) - Bannière instance de test : étendue aux hôtes "local" (camap.local/minikube), message clarifié (b709747)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[fix] Correction d'exceptions non trappées (emails invalides, souscription vide)
Contexte
Deux erreurs non trappées remontaient en production :
Dans
SubscriptionAdmin, la création d'une souscription sans commande levait unthrow "string"brut dansSubscriptionService.areVarOrdersValid()qui n'était pas attrapé par lecatch (error:Error)du contrôleur (qui attend untink.core.Error).Dans le cron
/cron/hour,sugoi/mail/Mail.addRecipient()lève une exception pour les adresses email invalides (ex.yahoo.f), crashant l'ensemble de la tâche cron.Solution
SubscriptionService: remplace les troisthrow "string"parthrow new Error(...)pour qu'ils soient correctement rattrapés par les contrôleurs.CronetVolunteerService: entoure chaque appeladdRecipient()d'untry/catch (e:Dynamic)pour ignorer les adresses invalides sans interrompre l'envoi aux autres destinataires. L'adresse problématique est loggée.Comment tester
hours'exécute sans erreur même si un membre a une adresse email mal formée.