User Guide

Table Of Contents
326 Chapter 14: Handling Errors
The structure at position 1 in the array represents the currently executing tag at the time the
exception was detected. The structure at position
ArrayLen(cfcatch.tagContext) represents
the initial tag in the stack of tags that were executing when the compiler detected the exception.
The following table lists the tagContext structure attributes:
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:
Entry Description
Column Obsolete (retained for backwards compatibility). Always 0.
ID The tag in which the exception occurred. Exceptions in CFScript are indicated by
two question marks (??). All custom tags, including those called directly, are
identified as cfmodule.
Line The line on the page in which the tag is located.
Raw_Trace The raw Java stack trace for the error.
Template The pathname of the application page that contains the tag.
Type The type of page; it is always a ColdFusion page.
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
cfcatch.nativeErrorCode is -
1. The value is 0 for queries of queries.
cfcatch.SQLState
The SQLState code associated with this exception. Database drivers
typically provide error codes to assist in the diagnosis of failing
database operations. SQLState codes are more consistent across
database systems than native error codes.
If the driver does not provide an SQLState value, the value of
cfcatch.SQLState is -1.
cfcatch.Sql
The SQL statement sent to the data source.
cfcatch.queryError
The error message as reported by the database driver.
cfcatch.where
If the query uses the cfqueryparam tag, query parameter name-value
pairs.
Property variable Description
cfcatch.ErrNumber
An internal expression error number, valid only when
type="Expression".