home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / cftry.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  785 b   |  44 lines

  1. <!--- CFTRY example, using CFTHROW to create
  2. a sample error --->
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. CFTRY Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BODY bgcolor=silver>
  12.  
  13. <H3>CFTRY Example</H3>
  14.  
  15. <!--- open a CFTRY block --->
  16. <CFTRY>
  17.  
  18. <!--- note that we have misspelled the tablename
  19. "employees" as "employeeas" --->
  20. <CFQUERY name="TestQuery" DATASOURCE="cfsnippets">
  21. SELECT *
  22. FROM EMPLOYEEAS
  23. </CFQUERY>
  24.  
  25. <P>... other processing goes here
  26.  
  27. <!--- specify the type of error for which we are fishing --->
  28. <CFCATCH TYPE="Database">
  29. <!--- the message to display --->
  30.     <H3>You've Thrown a Database <B>Error</B></H3>
  31. <CFOUTPUT>
  32. <!--- and the diagnostic message from the Cold
  33. Fusion server --->
  34.     <P>#CFCATCH.message#
  35. </CFOUTPUT>
  36. </CFCATCH>
  37.  
  38. </CFTRY>
  39.  
  40.  
  41. </BODY>
  42.  
  43. </HTML>       
  44.