Question about use of onException

I see onException listed as an interception point and also listed when
talking about customer framework error handling, but it isn't clear to
me whether you have to set up an ExceptionHandler and
CustomerErrorTemplate in your coldbox.xml file to get onException
working of if it will listen to exceptions regardless of those
settings.

Any clarification?

Thanks,
Judah

It is apart from the other two settings. onException fires as an interceptor, separate from the handler and custom bug report.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Hmm..then I don't seem to using the intercept point correctly.

I'm trying to catch exceptions in an interceptor. This is my most basic form:

<cffunction name="onException" access="public" returntype="void"
hint="Executes whenever the framework detects an exception "
output="false" >
        <cfargument name="event" required="true" type="any" hint="The
event object : coldbox.system.beans.requestContext">
        <cfargument name="interceptData" required="true" type="struct"
hint="A structure containing intercepted information. NONE BY DEFAULT
HERE">

      <cfscript>
            variables.logger.error("An error occurred");
      </cfscript>
</cffunction>

I know that the interceptor is registered correctly because my custom
intercept point is working. It is my understanding that I don't need
to announce this one because onException is a built in point. So I
should, I believe, just be able to define an onException method in my
intercept and it will get added to the list of things that listen for
exceptions, correct?

I do not have custom error handling defined in my app, so if I have an
error somewhere, I'd expect the framework to log the error and then
also see an additional error logged from my intercept that says "An
error occurred". Is that correct?

Currently, when I induce an error in my code by saying "foo = ;" in a
handler method somewhere, I see the exception logged by the framework
in my log file but nothing seems to be happening inside the
onException method I defined.

Also, what data should I have access to in this method? Is it the
cferror struct thrown by Coldfusion? Or is it an exception bean
created by Coldbox?

Thanks,
Judah

Dump the interceptdata and abort it in the onException so you can see what comes in. Also to see that it fires.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com