Re: Error of type -1
Re: Error of type -1
- Subject: Re: Error of type -1
- From: email@hidden (Michael Sullivan)
- Date: Fri, 31 May 2002 18:58:07 -0400
- Organization: Society for the Incurably Pompous
>
What the heck is an error of type -1? How do I avoid it?
I'm not sure *exactly* what the error is, but it generally happens when
an app tries to deal with memory that it doesn't own. One cannot always
completely eliminate them in some apps, but increasing memory allocation
usually helps.
>
I've made a script that resizes lots of big (40MB) images and adds
>
some info to a database. I let it go for a while (we're talking
>
hours here) and it seems to throw an error of type -1 in completely
>
different places. How would I address this?
I would try increasing the memory allocation of either the script or the
application it is driving. (If you're never storing big data in the
script, it's unlikely to be the script, but, I'd expect an app to quit
with a type -1 error as a dialog -- maybe it's also passing that to your
script. Can you tell whether the script itself is throwing the error,
or just not trapping an application thrown error?
Why not put the whole script in a try block to catch error -1 like this:
try
--stuff that eventually throws an error -1
on error -1
display dialog "The app did it!"
end try
Now, if the script throws an error -1, it will quit the script app, if
some app that you are throws an error -1, you will see that dialog.
That will tell you where you need to increase your allocation (or if you
have source -- debug the code so it throws Out of Memory instead of
stepping on the wrong bits).
Michael
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.