SPUG: Re: IO::All
Michael R. Wolf
MichaelRWolf at att.net
Fri May 21 15:22:13 CDT 2004
ced at carios2.ca.boeing.com writes:
> Hello everyone,
>
> I missed Brian's talk unfortunately but was there any mention
> of IO::All's error handling... was there a demo of subclassing
> throw() for instance?
In fact, there was a discussion of error handling. I don't want to
put words in Ingy's mouth, but it went along the lines of...
"Error handling? We don't need no stinkin' error handling!"
Humor and playfulness, aside -- I'd call it "error handling lite", or
"go ahead and let it die, if anyone cares, they'll wrap it with an
eval and catch it".
eval {
# Ingy code with no error handling goes here...
}
warn "Ingy-instigated errors $@" if $@;
I had a brief discussion with Jack about it on a ride home, basically
because Jack had asked a question about it during the talk. Much of
the discussion centered around a historical error-handling conundrum
-- propogate errors up the call stack and let callers check return
values (pessimistic -- check every call)
-- throw an exception and have callers ignore or propogate it up the
call stack to anyone who cares (optomistic -- assume sucess, catch
errors at the "right" level, and ignore them when you can)
--
Michael R. Wolf
All mammals learn by playing!
MichaelRWolf at att.net
More information about the spug-list
mailing list