Re: On the case for exception-based error handling.
[email protected] (Markus Peter) Tue, 22 Aug 2000 18:48:45 +0200
| Newsgroups | perl.perl6.language.errors |
|---|---|
| Message-ID | <4036179.3175958925@[192.168.1.6]> |
--On 22.08.2000 12:24 Uhr -0400 Chaim Frenkel wrote: > TO> return $FATAL_MODE ? ERROR_IO : throw Error::IO; > > Why make all module authors do that? Have core perl do that for you. > Make a pragma that would treat throw as a return. No cost to the > module author. This probably won't work. What would you return exactly? Also, there's plenty of chance that the return value could interfer with the regular return values of that function... This will never be possible without work done by the module author so the return value plays nicely. I'm not so sure either wether a function should only return error codes when it's called in non-fatal mode. I'd actually prefer to be able to enable/disable fatality for exceptions with a pragma without changing the interface (though that doesn't prevent having a mode where we'll have error modes), so that I can check exceptions when I want to.... -- Markus Peter - SPiN GmbH [email protected]