Dans mon application Grails, j'ai défini flux web ce qui suit (simplifié)Grails de gestion des exceptions de flux web
def registerFlow = {
start {
action {RegistrationCommand cmd ->
try {
memberService.validateRegistrationCommandDTO(cmd)
} catch (MemberException ex) {
flow.regErrorCode = ex.errorCode
throw ex
}
}
on("success").to "survey" // The 'survey' state has been omitted
on(MemberException).to "handleRegMemberException"
on(Exception).to "handleUnexpectedException"
}
handleRegMemberException {
action {
// Implementation omitted
}
}
handleUnexpectedException {
redirect(controller:'error', action:'serverError')
}
}
Si un MemberException est jeté par le « start » état, l'exécution doit procéder à la « handleRegMemberException » état, mais pas. Y a-t-il quelque chose qui ne va pas dans ma définition de flux ou ma compréhension de la façon dont cela devrait fonctionner?
Merci, Don