comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: catch and I/O errors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: catch and I/O errors [message #42873] Thu, 03 March 2005 09:11
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Good questions. I've forwarded them to the Book Club
> secretary. Perhaps we will get an answer. In the meantime,
> here is an article that pretty much exhausts what I know
> about the subject:
>
> http://www.dfanning.com/misc_tips/conversion_errors.html

OK, I'm trying to fix this, but I am running into semantic
problems.

According to the documentation, CATCH can catch any error
that occurs within IDL except "non-fatal warnings such
as math errors." My original understanding is that CATCH
could not catch input/output errors, and that a type
conversion error was a kind of input/output error.

But, I have verified that CATCH *can* catch normal input/output
errors. For example, you can catch the error of reading past
the end of a file. What it *can't* catch is type conversion
errors. So, using the elementary logic I learned in 8th grade,
a type conversion error must be a non-fatal math error.

All well and good EXCEPT that you can trap a type conversion
error with an ON_IOERROR condition, which would appear to
make it an input/output error. :-(

Anyone have any ideas about this?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: catch and I/O errors [message #42888 is a reply to message #42873] Wed, 02 March 2005 16:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Wallace writes:

> David, looks like it's time to get that secretary to do something! ;-)

She quit. Something about going "on and on about those
women in your yoga class." Guess I'll fix it myself. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: catch and I/O errors [message #42889 is a reply to message #42888] Wed, 02 March 2005 14:35 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> http://www.dfanning.com/misc_tips/conversion_errors.html

David's webpage says: 'The Catch documentation says that "all errors
that can be handled by IDL" can be trapped in this way.'

However, new and improved IDL documentation on Catch says : 'The CATCH
procedure provides a generalized mechanism for the handling of
exceptions and errors within IDL. Calling CATCH establishes an error
handler for the current procedure that intercepts all errors that can be
handled by IDL, excluding non-fatal warnings such as math errors.'

David, looks like it's time to get that secretary to do something! ;-)


Because the math errors are included in the non-fatal category, they
wound up grouped with the I/O errors. The I/O error handling was what
was needed for math errors, so the math errors just piggy-backed on the
same mechanism. Keep in mind that this is a wild and crazy guess based
on what I've seen. Someone correct me if I'm wrong. I really wish that
there were consistent error handling where you could differentiate
between the error types with a fatal/non-fatal flag or something similar.

-Mike
Re: catch and I/O errors [message #42890 is a reply to message #42889] Wed, 02 March 2005 14:05 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Hornberger writes:

> is there any way to handle I/O errors with catch? What's the distinction
> between I/O errors and other errors good for anyway?

Good questions. I've forwarded them to the Book Club
secretary. Perhaps we will get an answer. In the meantime,
here is an article that pretty much exhausts what I know
about the subject:

http://www.dfanning.com/misc_tips/conversion_errors.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL without X on Linux
Next Topic: �D : XDA mini ��t����� �� XDA O2 IIs Wireless �^��� .............

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Nov 29 11:56:17 PST 2025

Total time taken to generate the page: 0.30999 seconds