| 1 | 15 | ▶ | use 5.10.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 15 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 15 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | package Map::Metro::Exceptions; | ||
| 6 | |||
| 7 | # ABSTRACT: Exceptions for Map::Metro | ||
| 8 | 15 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | |
| 9 | 15 | our $VERSION = '0.2405'; | |
| 10 | |||
| 11 | 15 | ▶ | use Throwable::SugarFactory; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | exception IncompleteParse | ||
| 14 | => '' | ||
| 15 | => has => [desc => ( | ||
| 16 | is => 'ro', | ||
| 17 | lazy => 1, | ||
| 18 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 19 | 0 | my $self = shift; | |
| 20 | 0 | sprintf 'Missing either stations, lines or segments. Check the map file [%s] for errors', $self->mapfile; | |
| 21 | }, | ||
| 22 | 15 | )], | |
| 23 | => has => [mapfile => (is => 'ro')]; | ||
| 24 | |||
| 25 | |||
| 26 | exception LineidContainsIllegalCharacter | ||
| 27 | => '' | ||
| 28 | => has => [desc => ( | ||
| 29 | is => 'ro', | ||
| 30 | lazy => 1, | ||
| 31 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 32 | 0 | my $self = shift; | |
| 33 | 0 | sprintf 'Line id [%s] contains illegal character [%s]', $self->line_id, $self->illegal_character; | |
| 34 | }, | ||
| 35 | 15 | )], | |
| 36 | => has => [line_id => (is => 'ro')], | ||
| 37 | => has => [illegal_character => (is => 'ro')]; | ||
| 38 | |||
| 39 | |||
| 40 | exception LineidDoesNotExistInLineList | ||
| 41 | => '' | ||
| 42 | => has => [desc => ( | ||
| 43 | is => 'ro', | ||
| 44 | lazy => 1, | ||
| 45 | 1 | ▶ | default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 46 | 1 | my $self = shift; | |
| 47 | 1 | sprintf 'Line id [%s] does not exist in line list (maybe check segments?)', $self->line_id; | |
| 48 | }, | ||
| 49 | 15 | )], | |
| 50 | => has => [line_id => (is => 'ro')]; | ||
| 51 | |||
| 52 | |||
| 53 | exception StationNameDoesNotExistInStationList | ||
| 54 | => '' | ||
| 55 | => has => [desc => ( | ||
| 56 | is => 'ro', | ||
| 57 | lazy => 1, | ||
| 58 | 1 | ▶ | default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 59 | 1 | my $self = shift; | |
| 60 | 1 | sprintf 'Station name [%s] does not exist in station list (check segments or arguments)', $self->station_name; | |
| 61 | }, | ||
| 62 | 15 | )], | |
| 63 | => has => [station_name => (is => 'ro')]; | ||
| 64 | |||
| 65 | |||
| 66 | exception StationidDoesNotExist | ||
| 67 | => '' | ||
| 68 | => has => [desc => ( | ||
| 69 | is => 'ro', | ||
| 70 | lazy => 1, | ||
| 71 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 72 | 0 | my $self = shift; | |
| 73 | 0 | sprintf 'Station id [%s] does not exist (check arguments)', $self->station_id; | |
| 74 | }, | ||
| 75 | 15 | )], | |
| 76 | => has => [station_id => (is => 'ro')]; | ||
| 77 | |||
| 78 | |||
| 79 | exception NoSuchMap | ||
| 80 | => '' | ||
| 81 | => has => [desc => ( | ||
| 82 | is => 'ro', | ||
| 83 | lazy => 1, | ||
| 84 | 1 | ▶ | default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 85 | 1 | my $self = shift; | |
| 86 | 1 | sprintf 'Could not find map with name [%s] (check if it is installed)', $self->mapname; | |
| 87 | }, | ||
| 88 | 15 | )], | |
| 89 | => has => [mapname => (is => 'ro')]; | ||
| 90 | |||
| 91 | |||
| 92 | 15 | 1; | |
| 93 | |||
| 94 | __END__ | ||