Re: errors and their keywords and where catch can return to and stuff like that

[email protected] (Chaim Frenkel) 14 Aug 2000 18:17:02 -0400
Newsgroups perl.perl6.language.flow
Message-ID <[email protected]>
Let us get away from the globals as much as we can. This can easily
(I think) be taken care of by having the _exception_ itself have the
uncaught handler

	$exception = Exception::whatever->new
	$exception->uncaught_handler = CODEREF

<chaim>

>>>>> "JM" == James Mastros <[email protected]> writes:

JM> My proposal is:
JM> $Exception::<whatever>::onuncaught = CODEREF.

JM> Yes, this is a global.  It has to be; the definition of when/how this gets
JM> called is that if the unwind stack goes all the way /past/ the root of the
JM> code, this code ref gets called.  The only parameter is the exception.  The
JM> defalut would be sub {die shift;} (for "obviously" fatal things), which
JM> would make the program exit with a fatal exception.  Other normal choices
JM> would be undef, ignore it (non-defualt warnings, like bareword), and sub
JM> {warn shift;}, print out a warning message (default warnings, like... I
JM> can't think of any).

JM> The value of onuncaught should follow isa if it doesn't exist.

-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
[email protected]				               +1-718-236-0183