perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kee Hinckley <naz...@somewhere.com>
Subject Trapping errors from embperl subroutines
Date Fri, 15 Aug 2003 04:18:24 GMT
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't work here.  The best I've come up with is:

try {
     $this->process($udat{account_id});
     my $e = $this->Error();
     if ($e) {
         throw MyError(@{$this->ErrArray()});
     }
} otherwise {
     my $err = shift;
     $this->Error(0);
     ...
};

And yes, I really would like throw the error because my subclass of 
Error does things like call Syslog.

Is there anyway I can force the call to $this->process() to *not* 
trap any errors?

Is there a better way to detect that it has an rethrow them?
-- 
Kee Hinckley
http://www.messagefire.com/          Anti-Spam Service for your POP Account
http://commons.somewhere.com/buzz/   Writings on Technology and Society

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message