[Pythonmac-SIG] parameters to Scrap.GetScrap( ??, ??)
Jack Jansen
jack@oratrix.nl
Mon, 25 Oct 1999 13:56:01 +0200
> Is there some place I should be able to find stuff like that for myself? I
> didn't see anything like that in libmac.pdf, and I haven't found any other
> docs for MacPython.
If someone wants to pick up working on MacPython documentation: please, be my
guest. I know the docs are very incomplete and outdated, but I don't have time
to work on it....
> Here's the end of the traceback I get if I start up the program right after
> zeroing the scrap:
>
> TE.TEFromScrap()
> Mac OS Error: (-102, 'No object of that type in scrap')
>
> This looks like the relevant line in macerrors.py:
> noTypeErr = -102 #No object of that type in scrap
>
> My code at that point is
>
> try:
> TE.TEFromScrap()
> except macerrors.noTypeErr:
> print "Caught it!" #For debugging
> pass
The values in macerrors.py are the values you will be passed in the *argument*
to the exception. The exception you get for all (or, at least, almost all)
toolbox errors is MacOS.Error. This exception is also known as TE.Error,
Res.Error, etc etc etc.
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm