Aion-Carp

 view release on metacpan or  search on metacpan

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


our $VERSION = "1.6";

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/) {}
        else {
            $x =~ s/ at .*? line \d+\.\n\z//;
            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

use common::sense; use open qw/:std :utf8/;  use Carp qw//; use Cwd qw//; use File::Basename qw//; use File::Find qw//; use File::Slurper qw//; use File::Spec qw//; use File::Path qw//; use Scalar::Util qw//;  use Test::More 0.98;  use String::Diff q...
# # NAME
# 
# Aion::Carp - добавляет трассировку стека в исключения
# 
# # VERSION
# 
# 1.5
# 
# # SYNOPSIS
# 



( run in 1.704 second using v1.01-cache-2.11-cpan-30a0b3e4e11 )