File Coverage

blib/lib/Map/Tube/Exception.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 22 23 95.6


line stmt bran cond sub pod time code
1             package Map::Tube::Exception;
2             $Map::Tube::Exception::AUTHORITY = 'cpan:MANWAR';
3             $Map::Tube::Exception::VERSION = '3.25';
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.25
11              
12             =cut
13              
14 2     2   95249 use 5.006;
  2         5  
15 2     2   526 use Data::Dumper;
  2         6601  
  2         150  
16              
17 2     2   449 use Moo::Role;
  2         11882  
  2         23  
18 2     2   1147 use namespace::autoclean;
  2         16413  
  2         9  
19             requires qw(status);
20             with 'Throwable';
21              
22 2     2   1246 use overload q{""} => 'as_string', fallback => 1;
  2         4282  
  2         10  
23              
24             has method => (is => 'ro');
25             has message => (is => 'ro');
26             has filename => (is => 'ro');
27             has line_number => (is => 'ro');
28              
29             sub as_string {
30 21     21 0 5747 my ($self) = @_;
31              
32 21         195 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 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             | 132 | Invalid station line id. |
82             | 133 | Route not found. |
83             | 134 | Missing map name. |
84             +-------------+-------------------------------------------------------------+
85              
86             =head1 AUTHOR
87              
88             Mohammad Sajid Anwar, C<< >>
89              
90             =head1 REPOSITORY
91              
92             L
93              
94             =head1 BUGS
95              
96             Please report any bugs or feature requests through the web interface at L.
97             I will be notified, and then you'll automatically be notified of progress on your
98             bug as I make changes.
99              
100             =head1 SUPPORT
101              
102             You can find documentation for this module with the perldoc command.
103              
104             perldoc Map::Tube::Exception
105              
106             You can also look for information at:
107              
108             =over 4
109              
110             =item * BUG Report
111              
112             L
113              
114             =item * CPAN Ratings
115              
116             L
117              
118             =item * Search MetaCPAN
119              
120             L
121              
122             =back
123              
124             =head1 LICENSE AND COPYRIGHT
125              
126             Copyright (C) 2015 - 2026 Mohammad Sajid Anwar.
127              
128             This program is free software; you can redistribute it and/or modify it under
129             the terms of the the Artistic License (2.0). You may obtain a copy of the full
130             license at:
131              
132             L
133              
134             Any use, modification, and distribution of the Standard or Modified Versions is
135             governed by this Artistic License.By using, modifying or distributing the Package,
136             you accept this license. Do not use, modify, or distribute the Package, if you do
137             not accept this license.
138              
139             If your Modified Version has been derived from a Modified Version made by someone
140             other than you,you are nevertheless required to ensure that your Modified Version
141             complies with the requirements of this license.
142              
143             This license does not grant you the right to use any trademark, service mark,
144             tradename, or logo of the Copyright Holder.
145              
146             This license includes the non-exclusive, worldwide, free-of-charge patent license
147             to make, have made, use, offer to sell, sell, import and otherwise transfer the
148             Package with respect to any patent claims licensable by the Copyright Holder that
149             are necessarily infringed by the Package. If you institute patent litigation
150             (including a cross-claim or counterclaim) against any party alleging that the
151             Package constitutes direct or contributory patent infringement,then this Artistic
152             License to you shall terminate on the date that such litigation is filed.
153              
154             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
155             CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
156             WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
157             NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
158             REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
159             INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
160             OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
161              
162             =cut
163              
164             1; # End of Map::Tube::Exception