Skip to content

Instantly share code, notes, and snippets.

@kentfredric
Created October 19, 2009 12:58
Show Gist options
  • Save kentfredric/213339 to your computer and use it in GitHub Desktop.
Save kentfredric/213339 to your computer and use it in GitHub Desktop.
Carp::Always makes backtraces SUCK more for some reason.
package Foo::Controller::Broken;
use Moose;
extends 'Catalyst::Controller';
sub broken : Local : Args(0) {
my ( $c ) = shift;
# this is an intentional syntax error.
$c->foo
return 1;
}
1;
package Foo;
use utf8;
use Moose;
extends 'Catalyst';
__PACKAGE__->config( name => 'Foo' );
__PACKAGE__->setup();
1;
perl t.pl
syntax error at t.pl line 8
syntax error at lib/Foo/Controller/Broken.pm line 13, near "->foo
return"
BEGIN not safe after errors--compilation aborted at lib/Foo/Controller/Broken.pm line 14.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/5.10.1/Catalyst/Utils.pm line 280.
Compilation failed in require at t.pl line 8.
#!/usr/bin/perl
use strict;
use warnings;
use lib 'lib';
# Commenting this line out produces *Better* backtraces.
use Carp::Always;
# The error should not appear to come from here :/
require Foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment