I use the onError function inside Application.cfc to integrate with RayGun when the code is on live but when we are on dev I'd like to be able to revert back to the normal ColdFusion error event. At the moment I have some basic error handling in place but it isn't as good as the default ColdFusion behavior. Does anybody know if this is possible and how?
I intend to add this as a feature request for ColdFusion 12 if there is no way of doing it.
This works when I run it.
in Application.cfc
<cffunction name="onError" access="public" returntype="void">
<cfargument name="Exception" required=true type="any">
<cfif true>
<cfthrow object="#arguments.exception#">
<cfelse>
error
</cfif>
</cffunction>
in cfm page.
<cfscript>
X=Y; // Y is undefined
</cfscript>
All you have to do is replace <cfif true>
with something that identifies your development environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With