File Coverage

blib/lib/JSON/RPC2/AnyEvent/Constants.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 21 21 100.0


line stmt bran cond sub pod time code
1             package JSON::RPC2::AnyEvent::Constants;
2 5     5   86 use 5.010;
  5         17  
3 5     5   25 use strict;
  5         8  
  5         118  
4 5     5   25 use warnings;
  5         10  
  5         254  
5              
6              
7             my %constants;
8             BEGIN{
9             # Based upon JSON-RPC spec 2.0 - http://www.jsonrpc.org/specification
10 5     5   147 %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     5   28 use constant \%constants;
  5         10  
  5         552  
22              
23 5     5   2207 use parent qw(Exporter);
  5         1446  
  5         27  
24             our @EXPORT_OK = keys %constants;
25             our %EXPORT_TAGS = (all => [@EXPORT_OK]);
26              
27              
28             1;