Common/Procedure/Return/Version_1_1/Error.pm

filter: Statementstmt 88.8% 16 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 76.0% 19 / 25 CC 2 SCAR 11.0
CC
2
Cov
80%
deflate
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Common/Message.pm ↑ Summary Common/Procedure/Call/Version_1_1.pm »
1 #!/usr/bin/perl
2  
3 package JSON::RPC::Common::Procedure::Return::Version_1_1::Error;
4 2 $JSON::RPC::Common::Procedure::Return::Version_1_1::Error::VERSION = '0.11';
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 # ABSTRACT: JSON-RPC 1.1 error class.
7  
8 2 ▶use JSON::RPC::Common::TypeConstraints qw(JSONValue);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use namespace::clean -except => [qw(meta)];
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 extends qw(JSON::RPC::Common::Procedure::Return::Error);
13  
14 2 has '+message' => (
15 required => 1,
16 );
17  
18 2 has '+code' => (
19 default => 500,
20 );
21  
22 2 has name => (
23 is => "rw",
24 default => "JSONRPCError", # fucking idiots
25 );
26  
27 0 ▶sub deflate {
Subroutine deflate: not called CC=2 SCAR=17.9
Pod undocumented
28 0 my $self = shift;
29  
30 return {
31 0 ▶ name => $self->name,
Branch: 1 branch
BranchTrueFalseTotal
$self->has_data ? : 0 0 0
32 message => $self->message,
33 code => $self->code,
34 ( $self->has_data ? ( error => $self->data ) : () ),
35 },
36 }
37  
38 2 __PACKAGE__->meta->make_immutable;
39  
40 2 __PACKAGE__
41  
42 __END__
« Common/Message.pm ↑ Summary Common/Procedure/Call/Version_1_1.pm »