Aion-Carp

 view release on metacpan or  search on metacpan

lib/Aion/Carp.pm  view on Meta::CPAN

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
our $VERSION = "1.5";
 
use Carp qw//;
use Scalar::Util qw//;
 
sub handler {
    my ($x) = @_;
 
    if(!ref $x) {
        no utf8; use bytes;
        if($x =~ s/\n[ \t]+\.\.\.propagated at .* line \d+\.\n\z/\n/a) {}
        else {
            $x =~ s/ at .*? line \d+\.\n\z//a;
            my $c = Carp::longmess('');
            $c =~ s/^( at .*? line \d+)\.\n/$x\n\tdie(...) called$1\n/;
            $x = $c;
        }
    }
    elsif(Scalar::Util::reftype($x) eq "HASH" && !exists $x->{STACKTRACE}) {
        my $c = Carp::longmess("die(...) called");

t/aion/carp.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
use common::sense; use open qw/:std :utf8/; use Test::More 0.98; use Carp::Always::Color; sub _mkpath_ { my ($p) = @_; length($`) && !-e $`? mkdir($`, 0755) || die "mkdir $`: $!": () while $p =~ m!/!g; $p } BEGIN { my $t = `pwd`; chop $t; $t .= '/' ....
#
# Aion::Carp - added stacktrace to exceptions
#
# # VERSION
#
# 1.5
#
# # SYNOPSIS
#
subtest 'SYNOPSIS' => sub {



( run in 1.100 second using v1.01-cache-2.11-cpan-49f99fa48dc )