Re: [RESEND] Trapping errors

2005-02-22 Thread Robert Norris
On Wed, Feb 23, 2005 at 05:28:17AM +0100, Gerald Richter wrote: > > 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). > > > > I take a look at

Re: [RESEND] Trapping errors

2005-02-22 Thread Gerald Richter
Hi, > > 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). > I take a look at it if I can change the error handling in this way. I agree that thi

Re: [RESEND] Trapping errors

2005-02-22 Thread Robert Norris
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

RE: [RESEND] Trapping errors

2005-02-22 Thread Gerald Richter
> > > Instead use > > > > Execute({inputfile => '*', options => > > Embperl::Constant::optReturnError, > > errors => [EMAIL PROTECTED]) ; > > if (@errors) { > > Execute ( > > } > > > > I've been doing something recently with Execute and > @errors, and I noticed that the @errors array al

Re: [RESEND] Trapping errors

2005-02-22 Thread Martin Moss
> Instead use > > Execute({inputfile => '*', options => > Embperl::Constant::optReturnError, > errors => [EMAIL PROTECTED]) ; > if (@errors) { > Execute ( > } > I've been doing something recently with Execute and @errors, and I noticed that the @errors array also contained any 'warnin

Re: [RESEND] Trapping errors

2005-02-22 Thread Gerald Richter
> > And then in base.epl, something like this: > > eval { Execute('*') }; > if($@) { > Execute('error.epl', $@); > } > Instead use Execute({inputfile => '*', options => Embperl::Constant::optReturnError, errors => [EMAIL PROTECTED]) ; if (@errors) { Execute ( } Gerald

[RESEND] Trapping errors

2005-02-16 Thread Robert Norris
[Resend: I haven't recieved a reply, and I need to decide what to do very soon.] Hi all, I'm working with Embperl 2.0rc2, using Embperl::Object for the entire site. I've having some issues with error trapping, and I've been unable to figure it out by myself, so I seek your advice. My understandi

Trapping errors

2005-02-07 Thread Robert Norris
Hi all, I'm working with Embperl 2.0rc2, using Embperl::Object for the entire site. I've having some issues with error trapping, and I've been unable to figure it out by myself, so I seek your advice. My understanding so far is that compile errors will always cause a 500 error, and so can only be

Re: Trapping errors from embperl subroutines

2003-08-17 Thread Gerald Richter
> > try is basically an eval. The problem is that there isn't an > exception. Embperl catches the exception in it's eval, logs it to > apache, and then returns with Error() set to some value. Is your sub a pure Perl sub e.g. [! sub foo { } !] or a Embperl sub e.g [$sub$] ... ? For the first one

Re: Trapping errors from embperl subroutines

2003-08-17 Thread Kee Hinckley
At 12:51 PM +0200 8/17/03, Gerald Richter wrote: I am not quite sure what the try .. otherwise does internaly, but could you try what happens with you write eval { $this-> process ... } ; if ($@) { ... throw } does this catch you exception? try is basically an eval. The problem is that there isn't

Re: Trapping errors from embperl subroutines

2003-08-17 Thread Gerald Richter
> Running 1.x. I want to load a perl module (Execute('*') with import > set to 0) and then later in the routine call $this->process(). > > In normal perl code I would do this: > > try { > $this->process($udat{account_id}); > } otherwise { > my $err = shift; > $this->Error(0); >

Trapping errors from embperl subroutines

2003-08-14 Thread Kee Hinckley
Running 1.x. I want to load a perl module (Execute('*') with import set to 0) and then later in the routine call $this->process(). In normal perl code I would do this: try { $this->process($udat{account_id}); } otherwise { my $err = shift; $this->Error(0); ... }; But that doesn'