From 75f20230821c883d919d6a3f84d3930862bb8fd7 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Fri, 25 Nov 2011 15:23:10 +0000 Subject: minor fixes after seeing it on CPAN --- lib/Data/MultiValued/Exceptions.pm | 58 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'lib/Data/MultiValued/Exceptions.pm') 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 +as a base class. + +=head1 CLASSES + +=head2 C + +Base class for "not found" errors. Has a C 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 + +Subclass of L, 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 + +Subclass of L, 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 + +Thrown when an invalid range is supplied to a method. An invalid range +is a range with C greater than C. + +Stringifies to: + + invalid range: $from, $to + + $stack_trace + +=cut + package Data::MultiValued::Exceptions::BadRange;{ use Moose; extends 'Throwable::Error'; -- cgit v1.2.3