Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 71600
Status: open
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: mjd [...] plover.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: error reported at the wrong place in 2.0205
Date: Tue, 11 Oct 2011 13:27:21 -0400
To: bug-moose [...] rt.cpan.org
From: Mark Jason Dominus <mjd [...] plover.com>
Consider this module: package Foo; use Moose; warn "Moose version: ", Moose->VERSION(), "\n"; has attribute => ( lazy => 1, ); It produces the following output: ---- BEGIN ENCLOSURE Moose version: 2.0205 You cannot have a lazy attribute (attribute) without specifying a default value for it at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 472 Moose::Meta::Attribute::_process_lazy_option('Moose::Meta::Attribute', 'attribute', 'HASH(0x9f71720)') called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 302 Moose::Meta::Attribute::_process_options('Moose::Meta::Attribute', 'attribute', 'HASH(0x9f71720)') called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 88 Moose::Meta::Attribute::new('Moose::Meta::Attribute', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 114 Moose::Meta::Attribute::interpolate_class_and_new('Moose::Meta::Attribute', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Class.pm line 704 Moose::Meta::Class::_process_new_attribute('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Class.pm line 697 Moose::Meta::Class::_process_attribute('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Class.pm line 566 Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose.pm line 77 Moose::has('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Exporter.pm line 356 Moose::has('attribute', 'lazy', 1) called at /tmp/bug line 5 ---- BEGIN ENCLOSURE Reporting the error at Moose/Meta/Attribute.pm line 472 is unhelpful. It should be reported at line 5 (or 6) of /tmp/bug, where it actually occurs. Mark Jason Dominus mjd@plover.com
Subject: Re: [rt.cpan.org #71600] error reported at the wrong place in 2.0205
Date: Tue, 11 Oct 2011 12:54:40 -0500
To: Mark-Jason Dominus via RT <bug-Moose [...] rt.cpan.org>
From: Jesse Luehrs <doy [...] tozt.net>
On Tue, Oct 11, 2011 at 01:27:34PM -0400, Mark-Jason Dominus via RT wrote: Show quoted text
> It produces the following output: > > ---- BEGIN ENCLOSURE > Moose version: 2.0205 > You cannot have a lazy attribute (attribute) without specifying a default value for it at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 472 > [...] > Moose::has('attribute', 'lazy', 1) called at /tmp/bug line 5 > ---- BEGIN ENCLOSURE > > Reporting the error at Moose/Meta/Attribute.pm line 472 is unhelpful. > It should be reported at line 5 (or 6) of /tmp/bug, where it actually > occurs.
It does at least include that information (and this is why our general policy is to use confess everywhere by default). This is not likely to actually be fixed at least until our error system is entirely rewritten. -doy
Subject: Re: [rt.cpan.org #71600] error reported at the wrong place in 2.0205
Date: Tue, 11 Oct 2011 14:25:06 -0400
To: bug-Moose [...] rt.cpan.org
From: Mark Jason Dominus <mjd [...] plover.com>
Show quoted text
> It does at least include that information (and this is why our general > policy is to use confess everywhere by default).
Sure. But the policy is just a a hack around the fact that the errors are being reported for the wrong place. In more complex programs, the actual cause of the error is buried in the the middle of the stack trace. Show quoted text
> This is not likely to > actually be fixed at least until our error system is entirely rewritten.
I had hoped someone might be keeping a file of these types of problems against the day when your error system is entirely rewritten.
On Tue Oct 11 14:25:30 2011, mjd@plover.com wrote: Show quoted text
> I had hoped someone might be keeping a file of these types of problems > against the day when your error system is entirely rewritten.
That somebody is apparently RT, and the list isn't really long enough. However marking this stalled since in theory there is a branch to re-write the entire error system based on Sartak's promises from YAPC 2012 in Madison. (Marked stalled until that branch is merged) -Chris
Subject: Error reported at the wrong place in 2.0205
This is much better in newer Moose: Moose version: 2.1805 You cannot have a lazy attribute (attribute) without specifying a default value for it at /home/autarch/.perlbrew/libs/perl-5.24.0@dev/lib/perl5/x86_64-linux/Moose/Exporter.pm line 419 Moose::has('attribute', 'lazy', 1) called at foo line 5 Removing the reference to Moose::Exporter seems to be a bit tricky with Devel::StackTrace, since we end up with an error message like this: You cannot have a lazy attribute (attribute) without specifying a default value for it at foo line 5 This doesn't even tell you that there was a call to "Moose::has", which seems worse than the alternative. I think the only way to fix this would be to remove Devel::StackTrace from Moose::Exception entirely and find a different way to format the stack trace. That's not necessary a terrible idea.