At 01:07 PM 8/29/00 -0600, Tom Christiansen wrote:
> >Now, every error is guaranteed to be an object. You can call some method
> >or check some attribute of it to find out if it was an exception. If
> >you're checking a system() or `` failure, you use it in numerical
> >context. If you're checking a builtin failure, you use it in string
> >context (unless you have some fetish about errno).
>
>It's not a fetish. It's for portability and reliability. There is
>no guarantee of the precise text that strerror() would produce
>when passed EAGAIN or ENOENT, yet it is these errnos by symbolic
>name that the syscalls are defined to return.
I don't argue with this for a moment (I just haven't seen much code that
bothered). I am wondering whether Larry was saying in
http://www.mail-archive.com/perl6-language@perl.org/msg03111.html that we
could do better than checking integers:
>I think I agree with the folks that say errors should be caught by
>type, not by number. Just as a for instance, you ought to able to
>write a simple handler that catches any ERRNO-style error.
or whether I misunderstand.
--
Peter Scott
Pacific Systems Design Technologies