Displaying a message is just one form of returning. So far, I
think throwing (and, possibly, rethrowing) answers Nikos101's
question completely. The simplest case is as follows:
caller
=====
f();
<!--- handle failure --->
function f( ) {
<cfif REFind("^[a-zA-Z0-9]+$", arguments.field)
><!--- failure--->
<!--- throw--->
</cfif>
}
However, thowing also applies to an arbitrary sequence of
function calls. To illustrate, consider the following function
definitions. Suppose that f1 is reponsible for handling any failure
of the Nikos101 condition. However, the failure occurs in f3.
function f1( ) {
f2();
<!--- handle failure --->
}
function f2( ) {
f3();
<!--- rethrow--->
}
function f3( ) {
<cfif REFind("^[a-zA-Z0-9]+$", arguments.field)
><!--- failure--->
<!--- throw--->
</cfif>
}
Then the throw/rethrow mechanism ensures that the failure
will be propagated up the call stack to the appropriate handler,
namely, f1. The functions f2 and f3 don't need to know anything
about the failure.