On Fri, 23 Nov 2001, brian moseley wrote:

> > Do you just want a Exception->throw( stacktrace => 1,
> > error => 'foo' ) param?
> >
> > That's easy enough.
>
> that seems generally useful but isn't really how i'd prefer
> to use it. how about also a method fill_in_stacktrace that i
> can call after the exception is thrown? would the stacktrace
> be generated incorrectly?

There's no way to generate the stacktrace without preserving the info from
caller() at the time the exception is thrown.  Maybe I should just always
do this and then just have a flag indicating whether or not to include the
stacktrace by default when stringifying.

> > That'd be possible easily enough by simply calling the
> > 'set_sig' function multiple times, passing in a new
> > package each time.
>
> i wouldn't want to require every p5ee module to do that. the
> "core" or "runtime" should set things up so that p5ee
> modules magically get the benefit when they are loaded.

That wouldn't be necessary.

>
> > Maybe I'll add a param that will descend a hierarchy for
> > you so you can say:
> >
> > set_sig( __DIE__ =>
> >          sub { ref $_[0] ?
> >                die $_[0] :
> >                P5EE::Exception::Unknown->throw( error => join '', @_ ) },
> >          hierarchy => 'P5EE' );
> >
> > or something like that.
>
> would that meet the need i outlined above?

Yes.


-dave

/*==================
www.urth.org
We await the New Sun
==================*/

Reply via email to