Re: On the case for exception-based error handling.
[email protected] (Markus Peter) Wed, 23 Aug 2000 17:51:08 +0200
| Newsgroups | perl.perl6.language.errors |
|---|---|
| Message-ID | <9005337.3176041868@[192.168.1.6]> |
--On 22.08.2000 20:51 Uhr -0700 Glenn Linderman wrote:
> For example, if truly fatal errors could be
> distinguished, one could declare that a catch-all clause "catch { ... }"
> would not catch fatal errors, that it would be necessary to specifically
> list that you want to catch a fatal error... maybe "catch Fatal { ... }",
> or the like.
Yes, we'll probably need an easy way to distinguish truely, absolutely fatal
stuff (out of memory or some other sort of runtime error by the
interpreter) from ordinary exceptions.
I'm not sure though wether I like the usage of die to throw fatal
exceptions vs. throw for possibly non-fatal exceptions, especially
considering the fact that many modules currently use die for trivial stuff
like reporting wrong parameters...
A better way would probably be to use different base classes, like
Exception for an exception which might be a problem but not very serious
and Error for the real, usually always fatal problems.
--
Markus Peter - SPiN GmbH
[email protected]