在我的Grails应用程序,我已经定义了以下(简体)网页流量Grails的流量异常处理
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')
}
}
如果MemberException抛出的“启动”状态,执行应该进入“handleRegMemberException”状态,但事实并非如此。我的流程定义有什么问题,或者我对这种方式的理解如何?
谢谢, 唐