Defined in Application.cfc, invoked when an exception occurs that was not caught by a cftry or cfcatch statement.

function onError(exception, eventName) {} → returns void

Argument Reference

exception struct

A structure containing the exception similar to what the cfcatch tag has.

eventName string

The name of the application event at which the exception occurred. If no onRequest method is defined then an empty string may be passed.
  • onApplicationStart
  • onApplicationEnd
  • onRequest
  • onRequestStart
  • onSessionStart
  • onSessionEnd
  • [empty string]

Sample code invoking the onError function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub