Exception.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Exception/MissingPluginFuzzyFind.pm ↑ Summary Exception/DuplicateStationId.pm »
1 package Map::Tube::Exception;
2 2 $Map::Tube::Exception::AUTHORITY = 'cpan:MANWAR';
3 2 $Map::Tube::Exception::VERSION = '3.21';
4 =head1 NAME
5  
6 Map::Tube::Exception - Base exception package as Moo Role for Map::Tube::* family.
7  
8 =head1 VERSION
9  
10 version 3.21
11  
12 =cut
13  
14 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 requires qw(status);
20 2 with 'Throwable';
21  
22 2 ▶use overload q{""} => 'as_string', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 2 has method => (is => 'ro');
25 2 has message => (is => 'ro');
26 2 has filename => (is => 'ro');
27 2 has line_number => (is => 'ro');
28  
29 sub as_string {
30 21 ▶ my ($self) = @_;
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
31  
32 21 return sprintf("%s(): %s (status: %s) file %s on line %d\n",
33 $self->method, $self->message, $self->status,
34 $self->filename, $self->line_number);
35 }
36  
37 =head1 DESCRIPTION
38  
39 Base exception package as Moo Role for Map::Tube::* family.
40  
41 Extracted out of the distribution L<Map::Tube> v3.0,so that it can be shared with
42 Map::Tube and it's Map::Tube::* family. It has been re-structured in the process.
43  
44 =head1 STATUS CODES
45  
46 +-------------+-------------------------------------------------------------+
47 | Status Code | Description |
48 +-------------+-------------------------------------------------------------+
49 | 100 | Missing station name. |
50 | 101 | Invalid station name. |
51 | 102 | Missing station id. |
52 | 103 | Invalid station id. |
53 | 104 | Missing line name. |
54 | 105 | Invalid line name. |
55 | 106 | Missing node object i.e. Map::Tube::Node. |
56 | 107 | Invalid node object. |
57 | 108 | Missing plugin graph i.e Map::Tube::Plugin::Graph. |
58 | 109 | Duplicate station name. |
59 | 110 | Duplicate station id. |
60 | 111 | Found self linked station. |
61 | 112 | Found multi linked station. |
62 | 113 | Found multi lined station. |
63 | 114 | Found unsupported map. |
64 | 115 | Missing supported map. |
65 | 116 | Found unsupported object. |
66 | 117 | Missing supported object, Map::Tube::Node / Map::Tube::Line |
67 | 118 | Invalid supported object. |
68 | 119 | Invalid line id. |
69 | 120 | Missing line id. |
70 | 121 | Missing plugin fuzzy find i.e. Map::Tube::Plugin::FuzzyFind |
71 | 122 | Missing plugin formatter i.e. Map::Tube::Plugin::Formatter |
72 | 123 | Invalid line color. |
73 | 124 | Missing Map Data. |
74 | 125 | Found unsupported map data format. |
75 | 126 | Malformed Map Data. |
76 | 127 | Invalid color hex code. |
77 | 128 | Invalid line structure. |
78 | 129 | Invalid station structure. |
79 | 130 | Invalid background color. |
80 | 131 | Invalid color name. |
81 +-------------+-------------------------------------------------------------+
82  
83 =head1 AUTHOR
84  
85 Mohammad S Anwar, C<< <mohammad.anwar at yahoo.com> >>
86  
87 =head1 REPOSITORY
88  
89 L<https://github.com/manwar/Map-Tube-Exception>
90  
91 =head1 BUGS
92  
93 Please report any bugs or feature requests to C<bug-map-tube-exception at rt.cpan.org>,
94 or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Map-Tube-Exception>.
95 I will be notified, and then you'll automatically be notified of progress on your
96 bug as I make changes.
97  
98 =head1 SUPPORT
99  
100 You can find documentation for this module with the perldoc command.
101  
102 perldoc Map::Tube::Exception
103  
104 You can also look for information at:
105  
106 =over 4
107  
108 =item * RT: CPAN's request tracker (report bugs here)
109  
110 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Map-Tube-Exception>
111  
112 =item * AnnoCPAN: Annotated CPAN documentation
113  
114 L<http://annocpan.org/dist/Map-Tube-Exception>
115  
116 =item * CPAN Ratings
117  
118 L<http://cpanratings.perl.org/d/Map-Tube-Exception>
119  
120 =item * Search CPAN
121  
122 L<http://search.cpan.org/dist/Map-Tube-Exception/>
123  
124 =back
125  
126 =head1 LICENSE AND COPYRIGHT
127  
128 Copyright (C) 2015 - 2016 Mohammad S Anwar.
129  
130 This program is free software; you can redistribute it and/or modify it under
131 the terms of the the Artistic License (2.0). You may obtain a copy of the full
132 license at:
133  
134 L<http://www.perlfoundation.org/artistic_license_2_0>
135  
136 Any use, modification, and distribution of the Standard or Modified Versions is
137 governed by this Artistic License.By using, modifying or distributing the Package,
138 you accept this license. Do not use, modify, or distribute the Package, if you do
139 not accept this license.
140  
141 If your Modified Version has been derived from a Modified Version made by someone
142 other than you,you are nevertheless required to ensure that your Modified Version
143 complies with the requirements of this license.
144  
145 This license does not grant you the right to use any trademark, service mark,
146 tradename, or logo of the Copyright Holder.
147  
148 This license includes the non-exclusive, worldwide, free-of-charge patent license
149 to make, have made, use, offer to sell, sell, import and otherwise transfer the
150 Package with respect to any patent claims licensable by the Copyright Holder that
151 are necessarily infringed by the Package. If you institute patent litigation
152 (including a cross-claim or counterclaim) against any party alleging that the
153 Package constitutes direct or contributory patent infringement,then this Artistic
154 License to you shall terminate on the date that such litigation is filed.
155  
156 Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
157 CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
158 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
159 NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
160 REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
161 INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
162 OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
163  
164 =cut
165  
166 2 1; # End of Map::Tube::Exception
« Exception/MissingPluginFuzzyFind.pm ↑ Summary Exception/DuplicateStationId.pm »