| 1 | package GeoIP2::Error::Generic; | ||
| 2 | |||
| 3 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 8 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 8 | our $VERSION = '2.006000'; | |
| 7 | |||
| 8 | 8 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 8 | ▶ | use namespace::clean -except => 'meta'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 8 | extends 'Throwable::Error'; | |
| 13 | |||
| 14 | 8 | 1; | |
| 15 | |||
| 16 | # ABSTRACT: A generic exception | ||
| 17 | |||
| 18 | __END__ | ||
| 19 | |||
| 20 | =pod | ||
| 21 | |||
| 22 | =encoding UTF-8 | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | GeoIP2::Error::Generic - A generic exception | ||
| 27 | |||
| 28 | =head1 VERSION | ||
| 29 | |||
| 30 | version 2.006000 | ||
| 31 | |||
| 32 | =head1 SYNOPSIS | ||
| 33 | |||
| 34 | use 5.008; | ||
| 35 | |||
| 36 | use GeoIP2::WebService::Client; | ||
| 37 | use Scalar::Util qw( blessed ); | ||
| 38 | use Try::Tiny; | ||
| 39 | |||
| 40 | my $client = GeoIP2::WebService::Client->new( | ||
| 41 | account_id => 42, | ||
| 42 | license_key => 'abcdef123456', | ||
| 43 | ); | ||
| 44 | |||
| 45 | try { | ||
| 46 | $client->insights( ip => '24.24.24.24' ); | ||
| 47 | } | ||
| 48 | catch { | ||
| 49 | die $_ unless blessed $_; | ||
| 50 | die $_ if $_->isa('GeoIP2::Error::Generic'); | ||
| 51 | |||
| 52 | # handle other exceptions | ||
| 53 | }; | ||
| 54 | |||
| 55 | =head1 DESCRIPTION | ||
| 56 | |||
| 57 | This class represents a generic error. It extends L<Throwable::Error> and does | ||
| 58 | not add any additional attributes. | ||
| 59 | |||
| 60 | =head1 METHODS | ||
| 61 | |||
| 62 | This class has two methods, C<< $error->message() >>, and C<< | ||
| 63 | $error->stack_trace() >>. Both methods are inherited from L<Throwable::Error>. | ||
| 64 | |||
| 65 | =head1 SUPPORT | ||
| 66 | |||
| 67 | =head1 AUTHORS | ||
| 68 | |||
| 69 | =over 4 | ||
| 70 | |||
| 71 | =item * | ||
| 72 | |||
| 73 | Dave Rolsky <drolsky@maxmind.com> | ||
| 74 | |||
| 75 | =item * | ||
| 76 | |||
| 77 | Greg Oschwald <goschwald@maxmind.com> | ||
| 78 | |||
| 79 | =item * | ||
| 80 | |||
| 81 | Mark Fowler <mfowler@maxmind.com> | ||
| 82 | |||
| 83 | =item * | ||
| 84 | |||
| 85 | Olaf Alders <oalders@maxmind.com> | ||
| 86 | |||
| 87 | =back | ||
| 88 | |||
| 89 | =head1 COPYRIGHT AND LICENSE | ||
| 90 | |||
| 91 | This software is copyright (c) 2013 - 2018 by MaxMind, Inc. | ||
| 92 | |||
| 93 | This is free software; you can redistribute it and/or modify it under | ||
| 94 | the same terms as the Perl 5 programming language system itself. | ||
| 95 | |||
| 96 | =cut | ||