when you trap an error of type database, you're provided with SQLState 
and NativeErrorCode.  examine these with your CATCH, then do what you 
like with the user.

christopher olive, cto, vp of web development, vp it security
atnet solutions, inc.
410.931.4092
http://www.atnetsolutions.com


-----Original Message-----
From: Owens, Howard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 3:03 PM
To: CF-Talk
Subject: Custom error (cfthrow) question


I've used CFTRY/CFCATCH before.  But I've never been clear on exactly 
how to
catch specific ODBC type of errors, to put up a custom error message.

I want an error message for : ODBC Error Code = 22001 (String data 
right
truncation)

If that error comes up, as opposed to any other error, I want to be able 
to
say, "Hey buddy, you're input field is too big -- trim it back")  

I've used CFTHROW to do something like <cfif form.field is "blah"> throw
</cfif> .... but I'm not sure I can catch and ODBC error and throw a 
custom
error -- can I?  How would you handle this?

H.

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to