I
never really saw an exception as an exceptional (or rare) event. To me, it
simply meant that something is wrong, and that fit in well with the logic. Also,
the idea of returning a status seems a bit dangerous. Sure you can say 0 = bad,
1 = true, but why make the client need to remember stuff like that? If the
client just knows that an error will be thrown, it keeps things simpler
(imho).
=======================================================================
Raymond
Camden, ColdFusion Jedi Master for Mindseye, Inc
Member of Team
Macromedia
Email :
[EMAIL PROTECTED]
Blog :
www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus
"My ally is the
Force, and a powerful ally it is." - Yoda
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rod Buchan
Sent: Tuesday, September 16, 2003 8:56 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] qualifying data coming in to cfcPossibly off-topic, but is generating an error the "right" way to do this.Is the fact that the username/password combo already exists an "exceptional" event?I usually try to return an integer indicating the result (similar to the Win32 API) or return an object with status and message.Generating exceptions has significant overhead (stack traces get generated, etc) so they shouldn't be used as programming logic like an "if" statement. They should only be used for unexpected "exceptional" events.So perhaps you should put a try/catch in the cfc for unexpected events and either rethrow the error or return a status code or object.Just my two cents.-----Original
