Errors.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 41 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
get_message_error
2.0
new
2.0
CRAP 2.0
1 our $VERSION = '1.91'; # VERSION
2  
3 ################################################
4 package NpsSDK::TimeoutException;
5  
6 sub new {
7 my $self = {};
8 bless ($self, "NpsSDK::TimeoutException");
9 return $self;
10 }
11  
12 sub get_message_error {
13 my $self = shift;
14 return "A timeout error has ocurred \n";
15 }
16  
17 1;
18  
19 ################################################
20 package NpsSDK::ConnectionException;
21  
22 sub new {
23 my $self = {};
24 bless ($self, "NpsSDK::ConnectionException");
25 return $self;
26 }
27  
28 sub get_message_error {
29 my $self = shift;
30 return "Cannot connect to the server \n";
31 }
32  
33 1;
34  
35 ################################################
36 package NpsSDK::UnknownError;
37  
38 sub new{
39 my $self = shift;
40 bless ($self, "NpsSDK::UnknownError");
41 return $self;
42 }
43  
44 sub get_message_error {
45 my $self = shift;
46 return "An unknown error has ocurred \n";
47 }
48  
49 1;
50  
51 ################################################
52 package NpsSDK::LogException;
53  
54 sub error {
55 die "DEBUG level is not allowed on PRODUCTION ENVIRONMENT \n";
56 }
57  
58 ################################################
59 package NpsSDK::EnvironmentNotFound;
60  
61 sub error {
62 die "
63 The chosen environment is incorrect.
64 The right environments are the following:
65 0: PRODUCCION
66 1: STAGING
67 2: SANDBOX
68 \n";
69 }
70  
71 1;
72  
73 ################################################
74 package NpsSDK::IndexError;
75  
76 sub error {
77 die "The environment's index cannot be less than 0 \n";
78 }
79  
80 1;
81