I just ran into an interesting little problem...
I have an ExceptionHandler defined so that I can give users a nice
Sorry, Something Went Wrong! page and log the exception. Works great.
I also had RequestEndHandler defined but the method it referred to didn't exist.
So, at the end of every request, having completely rendered the
requested event correctly, ColdBox would try to call the request end
handler, which would throw an exception and ColdBox would then run the
ExceptionHandler - even tho' there's no possible way the handler could
display anything vaguely useful at this point since the (correct) view
has already been rendered.
Surely, any exceptions occurring *after* the request has completed
should be displayed as bare exceptions?
This had been happening in our application - silently - for ages and
we only spotted it because we enhanced our logging and saw strange
values appearing (reports of pages not found that were clearly present
and rendering just fine). Since the event being reported as apparently
being invalid was clearly a valid, working event, this took a little
while to track down. Obviously defining the handler method or removing
the RequestEndHandler declaration both worked to solve the issue but
my point about handling exceptions at the end of the request lifecycle
still stands...