line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Git::Class::Role::Error; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
148700
|
use Moo::Role; |
|
5
|
|
|
|
|
28597
|
|
|
5
|
|
|
|
|
37
|
|
4
|
5
|
|
|
5
|
|
6815
|
use Carp::Clan qw/^(Git::Class|Mouse|Moose)::/; |
|
5
|
|
|
|
|
9391
|
|
|
5
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has '_die_on_error' => ( |
7
|
|
|
|
|
|
|
is => 'rw', |
8
|
|
|
|
|
|
|
# isa => 'Bool', |
9
|
|
|
|
|
|
|
init_arg => 'die_on_error' |
10
|
|
|
|
|
|
|
); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'is_verbose' => ( |
13
|
|
|
|
|
|
|
is => 'rw', |
14
|
|
|
|
|
|
|
# isa => 'Bool', |
15
|
|
|
|
|
|
|
init_arg => 'verbose', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has '_error' => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
# isa => 'Str|Undef', |
21
|
|
|
|
|
|
|
# reader => '_last_error', # Mouse doesn't support reader yet |
22
|
|
|
|
|
|
|
trigger => sub { |
23
|
|
|
|
|
|
|
my ($self, $message) = @_; |
24
|
|
|
|
|
|
|
if (defined $message && $message ne '') { |
25
|
|
|
|
|
|
|
chomp $message; |
26
|
|
|
|
|
|
|
$self->_die_on_error |
27
|
|
|
|
|
|
|
? croak $message |
28
|
|
|
|
|
|
|
: carp $message; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |