throw vs the result

Jan Schenkel janschenkel at yahoo.com
Sun May 1 05:30:25 EDT 2005


--- Dar Scott <dsc at swcp.com> wrote:
> I was wondering what people prefer as far as "fatal"
> errors in 
> executing a custom command, such as in a library.
> 
> Should that be in a non-empty value returned by
> result()?
> 
> Or should that cause some error message to the
> thrown?
> 
> Or does it depend on the error?
> 
> Dar
> 

I personally prefer the try-throw-catch trinity, as it
makes for cleaner code than indented if-then-else
structures.
In fact, I wish all errors were thrown rather than
tucked away in the result. Maybe there's a good
bugzilla request with backward compatibility in this :
- if a global property is set, and a result-setting
error is encountered, the engine throws the error
- if nothing catches it, it sets the result and moves
along with the next line in the script.

Just my two eurocnts,

Jan Schenkel.

Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the use-livecode mailing list