Skip Menu |
 

This queue is for tickets about the TryCatch CPAN distribution.

Report information
The Basics
Id: 49072
Status: open
Priority: 0/
Queue: TryCatch

People
Owner: Nobody in particular
Requestors: CRAKRJACK [...] cpan.org
Cc: SMYLERS [...] cpan.fsck.com
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.001001
Fixed in: 1.001001



Subject: TryCatch forces you to capture your exception in a variable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 314
Download (untitled) / with headers
text/plain 314b
eg; this doesn't work: try { ... } catch (MyApp::Exception::CantLock) { $log->error("Can't lock output, skipped."); next OUTPUT; } instead, I have to: try { ... } catch (MyApp::Exception::CantLock $e) { $log->error("Can't lock output, skipped."); next OUTPUT; } ... even though I dont care about '$e'.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-27252-1252360021-1398.49072-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 484
Download (untitled) / with headers
text/plain 484b
On Thu Aug 27 16:11:57 2009, CRAKRJACK wrote: Show quoted text
> eg; this doesn't work: > > try { ... } > catch (MyApp::Exception::CantLock) { > $log->error("Can't lock output, skipped."); > next OUTPUT; > } > > instead, I have to: > > try { ... } > catch (MyApp::Exception::CantLock $e) { > $log->error("Can't lock output, skipped."); > next OUTPUT; > } > > ... even though I dont care about '$e'.
Hmm yeah that is a bit fail. Working on this. Expect a new version soon (within a week)
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-27252-1252360021-1398.49072-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.6.HEAD-27252-1252360021-1398.49072-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-19311-1292545049-222.49072-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 637
Download (untitled) / with headers
text/plain 637b
On Mon Sep 07 17:47:01 2009, ASH wrote: Show quoted text
> On Thu Aug 27 16:11:57 2009, CRAKRJACK wrote:
> > eg; this doesn't work: > > > > try { ... } > > catch (MyApp::Exception::CantLock) { > > $log->error("Can't lock output, skipped."); > > next OUTPUT; > > } > > > > instead, I have to: > > > > try { ... } > > catch (MyApp::Exception::CantLock $e) { > > $log->error("Can't lock output, skipped."); > > next OUTPUT; > > } > > > > ... even though I dont care about '$e'.
> > > Hmm yeah that is a bit fail. Working on this. Expect a new version soon > (within a week)
Hi... it's been a year now and this is still broken. Any update? :)
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-17551-1295023546-308.49072-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 151
Download (untitled) / with headers
text/plain 151b
I'm sorry I completely forgot about this bug. Could you try upgrading Parse::Method::Signatures and TryCatch and double check this is still the case?
From zarzavin [...] gmail.com Sun Jan 16 02: 29:48 2011
MIME-Version: 1.0
X-Spam-Status: No, score=-6.109 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_NEUTRAL=0.779, T_TO_NO_BRKTS_FREEMAIL=0.01] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-17551-1295023546-1410.49072-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-49072 [...] rt.cpan.org> <rt-3.8.HEAD-17551-1295023546-1410.49072-6-0 [...] rt.cpan.org>
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <AANLkTikX9Okwc2SXpZow5paLNOC14QD+ZXU_aYWG7Xfm [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary=90e6ba10a78349b3ef0499f1a19b
X-Spam-Score: -6.109
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Authentication-Results: hipster.bestpractical.com (amavisd-new); domainkeys=pass header.sender=zarzavin [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id DD8652413B2 for <cpan-bug+TryCatch [...] hipster.bestpractical.com>; Sun, 16 Jan 2011 02:29:47 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GwUweVlVSoce for <cpan-bug+TryCatch [...] hipster.bestpractical.com>; Sun, 16 Jan 2011 02:29:46 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C0C822410B0 for <bug-TryCatch [...] rt.cpan.org>; Sun, 16 Jan 2011 02:29:45 -0500 (EST)
Received: (qmail 24423 invoked by uid 103); 16 Jan 2011 07:29:45 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Jan 2011 07:29:45 -0000
Received: from mail-fx0-f50.google.com (HELO mail-fx0-f50.google.com) (209.85.161.50) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Sat, 15 Jan 2011 23:29:43 -0800
Received: by fxm14 with SMTP id 14so5013454fxm.9 for <bug-TryCatch [...] rt.cpan.org>; Sat, 15 Jan 2011 23:29:40 -0800 (PST)
Received: by 10.223.79.66 with SMTP id o2mr3051304fak.80.1295162978971; Sat, 15 Jan 2011 23:29:38 -0800 (PST)
Received: by 10.223.125.129 with HTTP; Sat, 15 Jan 2011 23:29:38 -0800 (PST)
Delivered-To: cpan-bug+TryCatch [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #49072] TryCatch forces you to capture your exception in a variable
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=ZtxGjiBZqqrY6q6BZnTqKxByPmimxg8k/F7I8CBedHxFz4+wCGLeAfS0bP4dZwNU5z 3oNUOPliwLONsWJ7Da432sS45AMmwDWK0xRS4wdm5shCM5r/gnZzdBbIcezk7UHY1x0X Mc1ITOrAb3kkWfITw68VkdKjnIWqN4FGLrZ5E=
Return-Path: <zarzavin [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=1d8Cb3zRTfnsVDW2Az5rlg5OVIjYLDmXCWkEpVJEfwQ=; b=TXk1u2j7GLP6AhQmXXbjGybBZd8TNSeOaAeh3PVh+2emETG8sRnK4LvcYmgVwOklA9 wkDgegIjal9bwYZGseoHwR6TQjeO63yOOWNoUKADfFTgUL8CiNnxfiftUoqSjniZlodB 3zLThImbKgJ2NwYWJ9FUwHLjYppXZRWR6fMzM=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+TryCatch [...] hipster.bestpractical.com
X-RT-Mail-Extension: trycatch
X-Google-Sender-Auth: P6hPy3JwAL3RZsazz8KFFS8Vzvw
Sender: zarzavin [...] gmail.com
Date: Sat, 15 Jan 2011 23:29:38 -0800
X-Spam-Level:
To: bug-TryCatch [...] rt.cpan.org
From: Tyler MacDonald <tyler [...] macdonald.name>
RT-Message-ID: <rt-3.8.HEAD-19315-1295162988-335.49072-0-0 [...] rt.cpan.org>
Content-Length: 0
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 675
Download (untitled) / with headers
text/plain 675b
Unfortunately, this is still a bug. :-( The following script renders an error, whereas if I add a "$e" in the catch(), everything is fine. { package ContrivedException; use Moose; has 'message' => (is => 'rw'); } use TryCatch; try { die ContrivedException->new(message => "yay"); } catch(ContrivedException) { print "We're good!\n"; } This is the actual error: Error parsing parameter near 'ContrivedException' in 'ContrivedException' at test.pl line 13 syntax error at test.pl line 13, near "} {" Missing right curly or square bracket at test.pl line 16, at end of line Execution of test.pl aborted due to compilation errors.
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 997
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-19315-1295162988-335.49072-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <RT-Ticket-49072 [...] rt.cpan.org> <rt-3.8.HEAD-17551-1295023546-1410.49072-6-0 [...] rt.cpan.org> <AANLkTikX9Okwc2SXpZow5paLNOC14QD+ZXU_aYWG7Xfm [...] mail.gmail.com> <rt-3.8.HEAD-19315-1295162988-335.49072-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18807-1307788097-323.49072-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 434
Download (untitled) / with headers
text/plain 434b
I have much the same problem, being forced to capture the error in a lexical: the default use of try/catch putting the error into $@ doesn't work. E.g. The following script outputs "Error: " instead of "Error: Oops": use TryCatch; try { die "Oops\n" } catch { print "Error: $@"; exit } print "OK\n"; If I use "catch ($err) { ... }" and print out "Error: $err" instead then all is well. Is this issue going to be addressed sometime?
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-18807-1307788097-323.49072-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-49072 [...] rt.cpan.org> <rt-3.8.HEAD-17551-1295023546-1410.49072-6-0 [...] rt.cpan.org> <AANLkTikX9Okwc2SXpZow5paLNOC14QD+ZXU_aYWG7Xfm [...] mail.gmail.com> <rt-3.8.HEAD-19315-1295162988-335.49072-0-0 [...] rt.cpan.org> <rt-3.8.HEAD-18807-1307788097-323.49072-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-3999-1513533945-1417.49072-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 168
Download (untitled) / with headers
text/plain 168b
Ash, Could you give me co-maint, and ideally push permission on https://github.com/ashb/trycatch as well? I'd like to fix this and especially the ". in @INC" problem.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.