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

  1. <!--- This example shows how to use CFTHROW to
  2. create an error --->
  3.  
  4. <HTML>
  5.  
  6. <HEAD>
  7. <TITLE>
  8. CFTHROW Example
  9. </TITLE>
  10. </HEAD>
  11.  
  12. <BODY bgcolor=silver>
  13.  
  14. <H3>CFTHROW Example</H3>
  15.  
  16. <!--- open a CFTRY block --->
  17. <CFTRY>
  18. <!--- define a condition upon which to throw
  19. the error --->
  20.     <CFIF NOT IsDefined("URL.myID")>
  21. <!--- throw the error --->
  22.         <CFTHROW MESSAGE="ID is not defined">
  23.     </CFIF>
  24.  
  25. <!--- perform the error catch --->
  26. <CFCATCH TYPE="application">
  27. <!--- display your message --->
  28.     <H3>You've Thrown an <B>Error</B></H3>
  29. <CFOUTPUT>
  30. <!--- and the diagnostic feedback from the
  31. application server --->
  32.     <P>#CFCATCH.message#
  33. </CFOUTPUT>
  34. </CFCATCH>
  35.  
  36. </CFTRY>
  37.  
  38.  
  39. </BODY>
  40.  
  41. </HTML>       
  42.