perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Norris <Robert.Nor...@its.monash.edu.au>
Subject Re: [RESEND] Trapping errors
Date Wed, 23 Feb 2005 02:04:35 GMT
Hi Gerald,

Thanks for your reply.

On Tue, Feb 22, 2005 at 05:52:33PM +0100, Gerald Richter wrote:
> > And then in base.epl, something like this:
> >
> >   eval { Execute('*') };
> >   if($@) {
> >       Execute('error.epl', $@);
> >   }
> >
> 
> Instead use
> 
> Execute({inputfile => '*', options => Embperl::Constant::optReturnError, 
> errors => \@errors}) ;
> if (@errors) {
> 	Execute (....
> }

This is almost working. The only problem I have now is that I'm throwing
and object reference (containing all sorts of info about the error).
Embperl seems to be stringifying it before dropping it into @errors, so
I get:

  [23835]ERR: 24: Error in Perl code: Util::Error=HASH(0x84f76f0)

Any way to make this behave more like croak/die? These seem to check if
their argument is a reference. If it is, they just drop the reference
into $@, otherwise they add context (line number, etc).

Thanks,
Rob.

Mime
View raw message