AnyEvent/Constants.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« AnyEvent.pm ↑ Summary
1 package JSON::RPC2::AnyEvent::Constants;
2 5 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 5 my %constants;
8 5 ▶BEGIN{
Subroutine BEGIN: called CC=1 SCAR=0.0
9 # Based upon JSON-RPC spec 2.0 - http://www.jsonrpc.org/specification
10 5 %constants = (
11 ERR_PARSE_ERROR => -32700, # Invalid JSON was received by the server.
12 # An error occurred on the server while parsing the JSON text.
13 ERR_INVALID_REQUEST => -32600, # The JSON sent is not a valid Request object.
14 ERR_METHOD_NOT_FOUND => -32601, # The method does not exist / is not available.
15 ERR_INVALID_PARAMS => -32602, # Invalid method parameter(s).
16 ERR_INTERNAL_ERROR => -32603, # Internal JSON-RPC error.
17 ERR_SERVER_ERROR => -32000, # -32000 to -32099: Reserved for implementation-defined server-errors.
18 );
19 }
20  
21 5 ▶use constant \%constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 5 ▶use parent qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 5 our @EXPORT_OK = keys %constants;
25 5 our %EXPORT_TAGS = (all => [@EXPORT_OK]);
26  
27  
28 5 1;
« AnyEvent.pm ↑ Summary