diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2011-11-25 15:23:10 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2011-11-25 15:23:10 +0000 |
commit | 75f20230821c883d919d6a3f84d3930862bb8fd7 (patch) | |
tree | 03933dd7cd89f6c910b6eae5e394c9e22bc2e2a9 /lib/Data/MultiValued/Exceptions.pm | |
parent | changes bump for CPAN release (diff) | |
download | data-multivalued-75f20230821c883d919d6a3f84d3930862bb8fd7.tar.gz data-multivalued-75f20230821c883d919d6a3f84d3930862bb8fd7.tar.bz2 data-multivalued-75f20230821c883d919d6a3f84d3930862bb8fd7.zip |
minor fixes after seeing it on CPAN
Diffstat (limited to 'lib/Data/MultiValued/Exceptions.pm')
-rw-r--r-- | lib/Data/MultiValued/Exceptions.pm | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/lib/Data/MultiValued/Exceptions.pm b/lib/Data/MultiValued/Exceptions.pm index 8d444c0..6495780 100644 --- a/lib/Data/MultiValued/Exceptions.pm +++ b/lib/Data/MultiValued/Exceptions.pm @@ -1,4 +1,21 @@ package Data::MultiValued::Exceptions; + +# ABSTRACT: exception classes + +=head1 DESCRIPTION + +This module defines a few exception classes, using L<Throwable::Error> +as a base class. + +=head1 CLASSES + +=head2 C<Data::MultiValued::Exceptions::NotFound> + +Base class for "not found" errors. Has a C<value> attribute, +containing the value that was not found. + +=cut + package Data::MultiValued::Exceptions::NotFound;{ use Moose; extends 'Throwable::Error'; @@ -16,8 +33,19 @@ sub as_string { return $str; } - } + +=head2 C<Data::MultiValued::Exceptions::TagNotFound> + +Subclass of L</Data::MultiValued::Exceptions::NotFound>, for +tags. Stringifies to: + + tag not found: $value + + $stack_trace + +=cut + package Data::MultiValued::Exceptions::TagNotFound;{ use Moose; extends 'Data::MultiValued::Exceptions::NotFound'; @@ -26,14 +54,40 @@ has '+message' => ( default => 'tag not found: ', ); } + +=head2 C<Data::MultiValued::Exceptions::RangeNotFound> + +Subclass of L</Data::MultiValued::Exceptions::NotFound>, for +ranges. Stringifies to: + + no range found for value: $value + + $stack_trace + +=cut + package Data::MultiValued::Exceptions::RangeNotFound;{ use Moose; extends 'Data::MultiValued::Exceptions::NotFound'; has '+message' => ( - default => 'no range found for value ', + default => 'no range found for value: ', ); } + +=head2 C<Data::MultiValued::Exceptions::BadRange> + +Thrown when an invalid range is supplied to a method. An invalid range +is a range with C<from> greater than C<to>. + +Stringifies to: + + invalid range: $from, $to + + $stack_trace + +=cut + package Data::MultiValued::Exceptions::BadRange;{ use Moose; extends 'Throwable::Error'; |