> > It occurs to me though that I should probably error catch that the
> > role passed to the function actually exists and if not return an
> > appropriate error, but how do I do this.  The place I get
> lost at is
> > the function returning the data has been designed to expect
> to return
> > a query {<cffunction name="displayBasicData" access="public"
> > output="false"
> > returntype="query...>}.  So if I place code there to capture and
> > return an error how would I do this with the function expecting to
> > return a query?  obviously I could not declare the return
> type and/or
> > allow output in the function but neither of these seem very
> proper to
> > me!
>
> You might use CFTHROW to pass CFC-specific errors to the
> caller of the CFC.
> It would then be the caller's responsibility to deal with the
> error appropriately, perhaps using an exception handler.
>

And as a follow up to that - I normally define a private Throw method in my
CFC so that the TYPE for my exception remains the same. Then in my CFC
methods I just do throw("You didn't do X right") where the argument is the
exception message.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to