Pilot/Exceptions.pm

filter: Statementstmt 98.4% 127 / 129 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 97.3% 36 / 37 Podpod 0.0% 0 / 1 totaltotal 97.6% 163 / 167 CC 1 SCAR 0.3
CC
1
Cov
98%
to_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Pilot/Events.pm ↑ Summary Pilot/Control.pm »
1 # Copyright (c) 2014 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 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 1 with 'Throwable';
30  
31 1 has 'error' => (
32 is => 'rw',
33 isa => 'Str',
34 );
35  
36 sub to_string
37 {
38 0 ▶ my ($self) = @_;
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
39 0 return $self->error;
40 }
41  
42 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 1 __PACKAGE__->meta->make_immutable;
44  
45  
46 package UAV::Pilot::NumberOutOfRangeException;
47 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 1 extends 'UAV::Pilot::Exception';
51  
52 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
53 1 __PACKAGE__->meta->make_immutable;
54  
55  
56 package UAV::Pilot::IOException;
57 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
58 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
59 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
60 1 extends 'UAV::Pilot::Exception';
61  
62 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
63 1 __PACKAGE__->meta->make_immutable;
64  
65  
66 package UAV::Pilot::FileNotFoundException;
67 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
68 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
69 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
70 1 extends 'UAV::Pilot::IOException';
71  
72 1 has 'file' => (
73 is => 'ro',
74 isa => 'Str',
75 );
76  
77 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
78 1 __PACKAGE__->meta->make_immutable;
79  
80  
81 package UAV::Pilot::CommandNotFoundException;
82 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
83 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
84 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
85 1 extends 'UAV::Pilot::IOException';
86  
87 1 has 'cmd' => (
88 is => 'ro',
89 isa => 'Str',
90 );
91  
92 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
93 1 __PACKAGE__->meta->make_immutable;
94  
95  
96 package UAV::Pilot::NavPacketException::BadHeader;
97 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
98 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
99 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
100 1 extends 'UAV::Pilot::Exception';
101  
102 1 has 'got_header' => (
103 is => 'ro',
104 isa => 'Int',
105 );
106  
107 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
108 1 __PACKAGE__->meta->make_immutable;
109  
110  
111 package UAV::Pilot::VideoException;
112 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
113 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
114 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
115 1 extends 'UAV::Pilot::Exception';
116  
117 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
118 1 __PACKAGE__->meta->make_immutable;
119  
120  
121 package UAV::Pilot::ArdupilotPacketException::BadHeader;
122 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
123 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
124 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
125 1 extends 'UAV::Pilot::Exception';
126  
127 1 has 'got_header' => (
128 is => 'ro',
129 isa => 'Int',
130 );
131  
132 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
133 1 __PACKAGE__->meta->make_immutable;
134  
135  
136 package UAV::Pilot::ArdupilotPacketException::BadChecksum;
137 1 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
138 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
139 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
140 1 extends 'UAV::Pilot::Exception';
141  
142 1 has 'got_checksum1' => (
143 is => 'ro',
144 isa => 'Int',
145 );
146 1 has 'got_checksum2' => (
147 is => 'ro',
148 isa => 'Int',
149 );
150 1 has 'expected_checksum1' => (
151 is => 'ro',
152 isa => 'Int',
153 );
154 1 has 'expected_checksum2' => (
155 is => 'ro',
156 isa => 'Int',
157 );
158  
159 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
160 1 __PACKAGE__->meta->make_immutable;
161  
162  
163 1 1;
164 __END__
165  
166  
167 =head1 NAME
168  
169 UAV::Pilot::Exceptions
170  
171 =head1 DESCRIPTION
172  
173 Exceptions that could be thrown by C<UAV::Pilot> modules. All inherit from
174 C<UAV::Pilot::Exception>, which does the role C<Throwable>.
175  
176 =head1 EXCEPTIONS
177  
178 =head2 UAV::Pilot::NumberOutOfRangeException
179  
180 =head2 UAV::Pilot::IOException
181  
182 =head2 UAV::Pilot::CommandNotFoundException
183  
184 =head2 UAV::Pilot::NavPacketException::BadHeader
185  
186 =head2 UAV::Pilot::VideoException
187  
188 =head2 UAV::Pilot::ArdupilotPacketException::BadHeader
189  
190 =head2 UAV::Pilot::ArdupilotPacketException::BadChecksum
191  
192 =cut
« Pilot/Events.pm ↑ Summary Pilot/Control.pm »