Mach-II/Mach-II-Framework — Issue #23: Make Capture of Events Easier in the handleException() Plugin Point
Author: mpwoodward
Created: 2012-03-01 01:00:12+00:00
State: open
Labels: enhancement

(Moved from http://trac.mach-ii.com/machii/ticket/433)

This stems from a discussion in the Mach-II group:

http://groups.google.com/group/mach-ii-for-coldfusion/browse_thread/thread/b358696ae745038

Currently, the handleException() plugin point can be called at any point in the event lifecycle or at any point in plugin processing. If the handleException() plugin point is called because of an error in the preProcess() plugin point (ie; the request is for an event which does not exist in the mach-ii.xml config file), the developer has to write code to check and see where the event is so that she can grab it and handle it appropriately. You end up needing this kind of boilerplate code over and over again:

` `
``
``
` `
` `
` `
` `
` `
` `
` `

It would be great if the framework could do two things:

Just figure out if the event needs to be grabbed from getNextEvent() or getCurrentEvent()
Flag an event as missing from the config via property (ie; isMissingEvent).
Of course, I'm not really sure how this could be accomplished. One suggestion from the above thread was that the call to the handleException() plugin point could have a third argument, set by the framework, which indicates if this is the nextEvent or currentEvent that you need to work with. Alternatively, if the framework could simply package this up behind the scenes and run the `` check just before it calls the handleException() plugin point, that would be swell too.