> I'm trying to catch the error below, but I'm not sure what
> scope it is in, or how to display it in an error template.
> When I wrap the cfstoredproc in a cftry tag, I can catch the
> error generically, but I cannot display this specific error
> message because I do not know what variable is holding it.
> It's not in the Error scope, for example. What can I put in
> the Cfdump var = "[Insert Var Here]" to get the message below,
> if any?
>
> Error Executing Database Query.  
> [Macromedia][SQLServer JDBC Driver][SQLServer]Violation of
> PRIMARY KEY constraint 'PK_Timer'. Cannot insert duplicate
> key in object 'Timer'.  
>
> I'm also trying to trap this error message in the stored proc
> itself, but that's for another group.

You can just dump the entire CFCATCH scope to see what's there:

<cfdump var="#CFCATCH#">

The variables you'll be interested in are CFCATCH.NativeErrorCode,
CFCATCH.SQLState and CFCATCH.QueryError, I think.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to