User Guide

Handling Exceptions in ColdFusion 207
The structure at position 1 of the array represents the outermost tag in the stack of
tags that were executing when the interpreter detected the exception. The structure
at position ArrayLen(
cfcatch.tagContext) represents the currently executing tag at
the time the interpreter detected the exception.
The tagContext structures have the following attributes:
Te m p la t e The pathname of the application page that contains the tag.
Line and Column The tags line number and column number within the
application page.
Note
Clear the Enable CFML stack trace option to avoid having production servers expend
resources creating a traceback stack by default. When you turn off this setting,
cfcatch.tagContext is a zero-length array.
Database exceptions
The following additional variables are available whenever the exception type is
database:
Expression exceptions
The following variable is only available for expression exceptions:
Property variable Description
cfcatch.nativeErrorCode
The native error code associated with this exception.
Database drivers typically provide error codes to assist
in the diagnosis of failing database operations. The
values assumed by cfcatch.NativeErrorCode are
driver-dependent.
If no error code is provided, the value of
nativeErrorCode is -1.
cfcatch.SQLState
The SQLState code associated with this exception.
Database drivers typically provide error codes to assist
in the diagnosis of failing database operations. The
values assumed by cfcatch.SQLState are
driver-dependent.
If no SQLState value was provided, the value of
SQLState is -1.
Property variable Description
cfcatch.errnumber
An internal expression error number, valid only when
type="Expression".