Created
October 19, 2009 12:58
-
-
Save kentfredric/213339 to your computer and use it in GitHub Desktop.
Carp::Always makes backtraces SUCK more for some reason.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Foo; | |
use utf8; | |
use Moose; | |
extends 'Catalyst'; | |
__PACKAGE__->config( name => 'Foo' ); | |
__PACKAGE__->setup(); | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl t.pl | |
syntax error at t.pl line 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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