Tiny/Error.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 91.6% 22 / 24 CC 2 SCAR 2.9
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Tiny/SessionCache.pm ↑ Summary
1 # Error object for RPC::Switch::Client::Tiny
2 #
3 package RPC::Switch::Client::Tiny::Error;
4  
5 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 22 our $VERSION = 1.1;
9  
10 77 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
11 77 my ($class, $type, $message, $extra) = @_;
12 77 ▶ return bless({type => $type, message => $message, $extra ? %$extra : ()}, $class);
Branch: 1 branch
BranchTrueFalseTotal
$extra ? : 19 58 77
13 }
14 22 ▶use overload 'fallback' => 1, '""' => 'stringify'; # allow to print object as "$err"
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 134 ▶sub stringify {
Subroutine stringify: called CC=1 SCAR=0.0
Pod undocumented
17 134 my ($self) = @_;
18 134 return "$self->{type} error: $self->{message}";
19 }
20  
21 22 1;
22  
23 __END__
« Tiny/SessionCache.pm ↑ Summary