Extending onError in Application.cfc
If a Fusebox application uses Application.cfc and extends Fusebox.Application Fusebox provides default behavior for onError. This includes a way to extend the error messages and error handling without overriding onError in Application CFC. If an application author determines the extension point for error handling is inadequate and chooses to over ride onError in the application's Application.cfc it is important to call super.onError() at the end of the application's implementation for onError. As of Fusebox 5.5 the omission of super.onError will have no ill affect on the server but it is important to note that new versions of Fusebox will be built and tests assuming Fusebox's onError routine is executed during each error.
Leveraging error templates
Fusebox ships with an errortemplates directory in the core. This directory can be copied out of the core and placed under the application's root directory. The application can then supply a modified genericErrorMessage.cfm or other stubbed out templates to extend/customize the error handling for that application.
Alternately the errortemplate directory could be placed anywhere on the server and leveraged from multiple Fusebox applications that reside in the same CFML instance. If the error template directory is placed outside of a single application, and not in the Fusebox core, the application will need to make Fusebox aware of the new location of the errortemplates directory. To do this application's Fusebox.xml will need an additional parameter of errortemplatesPath set to the new location (relative to the application or a mapped path beginning with /).
Add Comment