Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 39967 invoked from network); 23 Feb 2005 02:08:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Feb 2005 02:08:15 -0000 Received: (qmail 77100 invoked by uid 500); 23 Feb 2005 02:08:14 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 77080 invoked by uid 500); 23 Feb 2005 02:08:14 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 77066 invoked by uid 99); 23 Feb 2005 02:08:14 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from alpha9.its.monash.edu.au (HELO ALPHA9.ITS.MONASH.EDU.AU) (130.194.1.9) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 22 Feb 2005 18:08:12 -0800 Received: from localhost ([130.194.13.88]) by vaxh.its.monash.edu.au (PMDF V5.2-31 #39306) with ESMTP id <01LL58A5E3TS8WWA12@vaxh.its.monash.edu.au> for embperl@perl.apache.org; Wed, 23 Feb 2005 13:07:52 +1100 Received: from moe.its.monash.edu.au (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with ESMTP id 4B6A3AB545; Wed, 23 Feb 2005 13:07:51 +1100 (EST) Received: from katsumi (katsumi.its.monash.edu.au [130.194.2.189]) by moe.its.monash.edu.au (Postfix) with ESMTP id 1DF2A4FB04; Wed, 23 Feb 2005 13:07:50 +1100 (EST) Received: by katsumi (Postfix, from userid 1000) id 8FF8844223; Wed, 23 Feb 2005 13:04:35 +1100 (EST) Date: Wed, 23 Feb 2005 13:04:35 +1100 From: Robert Norris Subject: Re: [RESEND] Trapping errors In-reply-to: <200502221752.33532.richter@ecos.de> To: embperl@perl.apache.org Cc: Gerald Richter Message-id: <20050223020435.GL3144@katsumi> MIME-version: 1.0 Content-type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/D3X8sky0X3AmG5" Content-disposition: inline User-Agent: Mutt/1.5.6+20040907i References: <20050217000729.GI21895@katsumi> <200502221752.33532.richter@ecos.de> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --W/D3X8sky0X3AmG5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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', $@); > > } > > >=20 > Instead use >=20 > Execute({inputfile =3D> '*', options =3D> Embperl::Constant::optReturnErr= or,=20 > errors =3D> \@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=3DHASH(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. --W/D3X8sky0X3AmG5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCG+SzWb13Z/wY5sIRAtPzAJ9PAvKGVKk/sgQFZ0/Pq7ZpjmvyDQCcDN4j IdMnaaWNfTLJgruzPpkoI1Q= =1aAi -----END PGP SIGNATURE----- --W/D3X8sky0X3AmG5--