RE: Catching this Error

2004-06-25 Thread Pascal Peters
In your cfcatch do cfdump var=#cfcatch# to see what is in there 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: vrijdag 25 juni 2004 15:52
 To: CF-Talk
 Subject: Catching this Error
 
 Hi,
 
 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.
 
 TIA.
 
 Sincerely,
 Andrew
 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Catching this Error

2004-06-25 Thread Dave Watts
 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]