Wondering the best approach to take here to catch errors caused by
framework initialization issues.
Here's the situation.
I have a running copy of ColdBox 2.6.1 and my app is running along
just dandy. Without restarting CF, I replace my Coldbox system
directory with that of ColdBox 2.6.3. Next step? Restart CF to load
the new stuff into memory.
But before I do, people start getting the nasty error on their screen:
Oops! Exception Encountered
Framework Initialization/Configuration Exception
Error Type: Framework.SettingNotFoundException : [N/A]
Error Messages: The setting IOCFrameworkReload does not exist.
FWSetting flag is false
In my app's config\coldbox.xml.cfm, I have the CustomErrorTemplate
defined, but it isnt using it. This is the standard, ugly dump of
error-ness.
What approach should I take to try to catch these and hanldle them?
Something in the coldbox.cfc I should edit?
A try/catch in my application.cfc won't catch this. In the example I
described, my application.cfc calls reloadCheck() in the
onRequestStart method. reloadChecks() has its own try/catch logic,
which is why it is not thrown up the chain to my application.cfc to
catch.
So before I go and add in all this extra code to coldbox.cfc, I wanted
to see what a "recommended" approach would be -- ideally, it would use
the customErrorTemplate Ive already defined instead of the one it
currently uses.
I had a similar desire to display a more elegant message for a
different framework error as described in the link below. I also found
no other option as of v2.6.3 but to modify the framework along the
same lines.
I'll let Tim give specifics as our needs were different and his error
seems fresh and reproducible. My post is 3 months old and a lot of
code has changed since then.
I chimed in mostly to let him know that he was not alone in
experiencing a case where an error could not be handled elegantly. I
find some comfort in knowing that others have experienced a similar
problem even if no solution is available.