The <CFABORT> tag allows you to stop the execution of a ColdFusion page dead in its tracks.
This can be handy for stopping the processing of a page when some sort of error condition occures.
One of the recent uses I have found for this tag is to use it in conjunction with the CFINCLUDE tag
to conditionally bring up a page based on specific conditions... such as what the browser is. For example:
on a regular page, near the top of the page, have code that checks if the browser is Safari for the iPhone.
If this is true, do a CFINCLUDE to bring up the iPhone version of the page. Then do a CFABORT tag so that the
rest of the regular page is not processed.
Syntax:
<CFABORT [SHOWERROR="Error Text"]>
Attributes:
ATTRIBUTE
DESCRIPTION
COMMENTS
SHOWERROR
Error Message Text
Optional.
Example:
<CFIF NOT IsDefined("URL.person")>
<CFOUTPUT>Person Parameter missing. Cannot view Page!</CFOUTPUT>
<CFABORT> <-- stop processing this page! -->
</CFIF>