throw vs the result

Derek Bump webmaster at dreamscapesoftware.com
Sat Apr 30 18:42:29 EDT 2005


Dar Scott 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 will tell you what I prefer, put it all into the result.  My reason: 
I hate the idea that a custom library, or even the Rev IDE, will not 
allow my script to continue because it ran into an error doing something.

For Example:  When someone tries to modify an image with JPEGCompress, 
sometimes the IDE hick ups and spits out the "can't open file (or mask 
file)" error and stops my script completely.  This is extremely annoying 
when it could just return that same error in a result which my script 
could test for and decide what to do.

It's just easier on the target and gives the programmer more control.


Derek Bump
Dreamscape Software
http://www.dreamscapesoftware.com/


More information about the use-livecode mailing list