Pilot/Exceptions.pm

filter: Statementstmt 98.5% 136 / 138 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 97.3% 36 / 37 Podpod 0.0% 0 / 1 totaltotal 97.7% 172 / 176 CC 1 SCAR 0.3
CC
1
Cov
99%
to_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Pilot/Events.pm ↑ Summary Pilot/Control.pm »
1 # Copyright (c) 2015 Timm Murray
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
6 #
7 # * Redistributions of source code must retain the above copyright notice,
8 # this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 #
13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 # POSSIBILITY OF SUCH DAMAGE.
24 package UAV::Pilot::Exception;
25 1 $UAV::Pilot::Exception::VERSION = '1.1';
26 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 1 with 'Throwable';
31  
32 1 has 'error' => (
33 is => 'rw',
34 isa => 'Str',
35 );
36  
37 sub to_string
38 {
39 0 ▶ my ($self) = @_;
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
40 0 return $self->error;
41 }
42  
43 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 1 __PACKAGE__->meta->make_immutable;
45  
46  
47 package UAV::Pilot::NumberOutOfRangeException;
48 1 $UAV::Pilot::NumberOutOfRangeException::VERSION = '1.1';
49 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
51 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
52 1 extends 'UAV::Pilot::Exception';
53  
54 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
55 1 __PACKAGE__->meta->make_immutable;
56  
57  
58 package UAV::Pilot::IOException;
59 1 $UAV::Pilot::IOException::VERSION = '1.1';
60 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
61 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
62 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
63 1 extends 'UAV::Pilot::Exception';
64  
65 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
66 1 __PACKAGE__->meta->make_immutable;
67  
68  
69 package UAV::Pilot::FileNotFoundException;
70 1 $UAV::Pilot::FileNotFoundException::VERSION = '1.1';
71 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
72 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
73 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
74 1 extends 'UAV::Pilot::IOException';
75  
76 1 has 'file' => (
77 is => 'ro',
78 isa => 'Str',
79 );
80  
81 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
82 1 __PACKAGE__->meta->make_immutable;
83  
84  
85 package UAV::Pilot::CommandNotFoundException;
86 1 $UAV::Pilot::CommandNotFoundException::VERSION = '1.1';
87 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
88 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
89 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
90 1 extends 'UAV::Pilot::IOException';
91  
92 1 has 'cmd' => (
93 is => 'ro',
94 isa => 'Str',
95 );
96  
97 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
98 1 __PACKAGE__->meta->make_immutable;
99  
100  
101 package UAV::Pilot::NavPacketException::BadHeader;
102 1 $UAV::Pilot::NavPacketException::BadHeader::VERSION = '1.1';
103 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
104 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
105 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
106 1 extends 'UAV::Pilot::Exception';
107  
108 1 has 'got_header' => (
109 is => 'ro',
110 isa => 'Int',
111 );
112  
113 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
114 1 __PACKAGE__->meta->make_immutable;
115  
116  
117 package UAV::Pilot::VideoException;
118 1 $UAV::Pilot::VideoException::VERSION = '1.1';
119 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
120 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
121 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
122 1 extends 'UAV::Pilot::Exception';
123  
124 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
125 1 __PACKAGE__->meta->make_immutable;
126  
127  
128 package UAV::Pilot::ArdupilotPacketException::BadHeader;
129 1 $UAV::Pilot::ArdupilotPacketException::BadHeader::VERSION = '1.1';
130 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
131 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
132 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
133 1 extends 'UAV::Pilot::Exception';
134  
135 1 has 'got_header' => (
136 is => 'ro',
137 isa => 'Int',
138 );
139  
140 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
141 1 __PACKAGE__->meta->make_immutable;
142  
143  
144 package UAV::Pilot::ArdupilotPacketException::BadChecksum;
145 1 $UAV::Pilot::ArdupilotPacketException::BadChecksum::VERSION = '1.1';
146 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
147 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
148 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
149 1 extends 'UAV::Pilot::Exception';
150  
151 1 has 'got_checksum1' => (
152 is => 'ro',
153 isa => 'Int',
154 );
155 1 has 'got_checksum2' => (
156 is => 'ro',
157 isa => 'Int',
158 );
159 1 has 'expected_checksum1' => (
160 is => 'ro',
161 isa => 'Int',
162 );
163 1 has 'expected_checksum2' => (
164 is => 'ro',
165 isa => 'Int',
166 );
167  
168 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
169 1 __PACKAGE__->meta->make_immutable;
170  
171  
172 1 1;
173 __END__
174  
175  
176 =head1 NAME
177  
178 UAV::Pilot::Exceptions
179  
180 =head1 DESCRIPTION
181  
182 Exceptions that could be thrown by C<UAV::Pilot> modules. All inherit from
183 C<UAV::Pilot::Exception>, which does the role C<Throwable>.
184  
185 =head1 EXCEPTIONS
186  
187 =head2 UAV::Pilot::NumberOutOfRangeException
188  
189 =head2 UAV::Pilot::IOException
190  
191 =head2 UAV::Pilot::CommandNotFoundException
192  
193 =head2 UAV::Pilot::NavPacketException::BadHeader
194  
195 =head2 UAV::Pilot::VideoException
196  
197 =head2 UAV::Pilot::ArdupilotPacketException::BadHeader
198  
199 =head2 UAV::Pilot::ArdupilotPacketException::BadChecksum
200  
201 =cut
« Pilot/Events.pm ↑ Summary Pilot/Control.pm »