File Coverage

blib/lib/Map/Tube/API/Exception.pm
Criterion Covered Total %
statement 11 13 84.6
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 15 19 78.9


line stmt bran cond sub pod time code
1             package Map::Tube::API::Exception;
2              
3             $Map::Tube::API::Exception::VERSION = '0.05';
4             $Map::Tube::API::Exception::AUTHORITY = 'cpan:MANWAR';
5              
6             =head1 NAME
7              
8             Map::Tube::API::Exception - Interface to exception class for Map::Tube::API.
9              
10             =head1 VERSION
11              
12             Version 0.05
13              
14             =cut
15              
16 1     1   13 use 5.006;
  1         3  
17 1     1   435 use Moo;
  1         8225  
  1         4  
18 1     1   1561 use namespace::autoclean;
  1         8899  
  1         2  
19             with 'Throwable';
20              
21 1     1   56 use overload q{""} => 'as_string', fallback => 1;
  1         1  
  1         5  
22              
23             has code => (is => 'ro', required => 1);
24             has message => (is => 'ro', required => 1);
25              
26             sub as_string {
27 0     0 0   my ($self) = @_;
28              
29 0           return sprintf("ERROR: %s (status: %s)\n", $self->message, $self->code);
30             }
31              
32             =head1 DESCRIPTION
33              
34             B
35              
36             =head1 AUTHOR
37              
38             Mohammad S Anwar, C<< >>
39              
40             =head1 REPOSITORY
41              
42             L
43              
44             =head1 BUGS
45              
46             Please report any bugs or feature requests to C,
47             or through the web interface at L.
48             I will be notified, and then you'll automatically be notified of progress on your
49             bug as I make changes.
50              
51             =head1 SUPPORT
52              
53             You can find documentation for this module with the perldoc command.
54              
55             perldoc Map::Tube::API::Exception
56              
57             You can also look for information at:
58              
59             =over 4
60              
61             =item * RT: CPAN's request tracker (report bugs here)
62              
63             L
64              
65             =item * AnnoCPAN: Annotated CPAN documentation
66              
67             L
68              
69             =item * CPAN Ratings
70              
71             L
72              
73             =item * Search CPAN
74              
75             L
76              
77             =back
78              
79             =head1 LICENSE AND COPYRIGHT
80              
81             Copyright (C) 2017 Mohammad S Anwar.
82              
83             This program is free software; you can redistribute it and/or modify it under
84             the terms of the the Artistic License (2.0). You may obtain a copy of the full
85             license at:
86              
87             L
88              
89             Any use, modification, and distribution of the Standard or Modified Versions is
90             governed by this Artistic License.By using, modifying or distributing the Package,
91             you accept this license. Do not use, modify, or distribute the Package, if you do
92             not accept this license.
93              
94             If your Modified Version has been derived from a Modified Version made by someone
95             other than you,you are nevertheless required to ensure that your Modified Version
96             complies with the requirements of this license.
97              
98             This license does not grant you the right to use any trademark, service mark,
99             tradename, or logo of the Copyright Holder.
100              
101             This license includes the non-exclusive, worldwide, free-of-charge patent license
102             to make, have made, use, offer to sell, sell, import and otherwise transfer the
103             Package with respect to any patent claims licensable by the Copyright Holder that
104             are necessarily infringed by the Package. If you institute patent litigation
105             (including a cross-claim or counterclaim) against any party alleging that the
106             Package constitutes direct or contributory patent infringement,then this Artistic
107             License to you shall terminate on the date that such litigation is filed.
108              
109             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
110             CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
111             WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
112             NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
113             REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
114             INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
115             OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
116              
117             =cut
118              
119             1; # End of Map::Tube::API::Exception