summaryrefslogtreecommitdiff
path: root/lib/Data/MultiValued/Exceptions.pm
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>2011-11-25 15:15:01 +0000
committerGianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>2011-11-25 15:15:01 +0000
commit22cbedcbd3b8ebfcd2b2e945fdad13a4108d640d (patch)
tree083fd2c946ec615cde31529ab00b23ccbb90e870 /lib/Data/MultiValued/Exceptions.pm
parentBuild results of 6e5e90b (on master) (diff)
parentchanges bump for CPAN release (diff)
downloaddata-multivalued-22cbedcbd3b8ebfcd2b2e945fdad13a4108d640d.tar.gz
data-multivalued-22cbedcbd3b8ebfcd2b2e945fdad13a4108d640d.tar.bz2
data-multivalued-22cbedcbd3b8ebfcd2b2e945fdad13a4108d640d.zip
Build results of 44cf53d (on master)
Diffstat (limited to 'lib/Data/MultiValued/Exceptions.pm')
-rw-r--r--lib/Data/MultiValued/Exceptions.pm70
1 files changed, 60 insertions, 10 deletions
diff --git a/lib/Data/MultiValued/Exceptions.pm b/lib/Data/MultiValued/Exceptions.pm
index b86199e..4d6a1b6 100644
--- a/lib/Data/MultiValued/Exceptions.pm
+++ b/lib/Data/MultiValued/Exceptions.pm
@@ -1,13 +1,17 @@
package Data::MultiValued::Exceptions;
{
- $Data::MultiValued::Exceptions::VERSION = '0.0.1_1';
+ $Data::MultiValued::Exceptions::VERSION = '0.0.1_2';
}
{
$Data::MultiValued::Exceptions::DIST = 'Data-MultiValued';
}
+
+# ABSTRACT: exception classes
+
+
package Data::MultiValued::Exceptions::NotFound;
{
- $Data::MultiValued::Exceptions::NotFound::VERSION = '0.0.1_1';
+ $Data::MultiValued::Exceptions::NotFound::VERSION = '0.0.1_2';
}
{
$Data::MultiValued::Exceptions::NotFound::DIST = 'Data-MultiValued';
@@ -28,11 +32,12 @@ sub as_string {
return $str;
}
-
}
+
+
package Data::MultiValued::Exceptions::TagNotFound;
{
- $Data::MultiValued::Exceptions::TagNotFound::VERSION = '0.0.1_1';
+ $Data::MultiValued::Exceptions::TagNotFound::VERSION = '0.0.1_2';
}
{
$Data::MultiValued::Exceptions::TagNotFound::DIST = 'Data-MultiValued';
@@ -44,9 +49,11 @@ has '+message' => (
default => 'tag not found: ',
);
}
+
+
package Data::MultiValued::Exceptions::RangeNotFound;
{
- $Data::MultiValued::Exceptions::RangeNotFound::VERSION = '0.0.1_1';
+ $Data::MultiValued::Exceptions::RangeNotFound::VERSION = '0.0.1_2';
}
{
$Data::MultiValued::Exceptions::RangeNotFound::DIST = 'Data-MultiValued';
@@ -55,12 +62,14 @@ use Moose;
extends 'Data::MultiValued::Exceptions::NotFound';
has '+message' => (
- default => 'no range found for value ',
+ default => 'no range found for value: ',
);
}
+
+
package Data::MultiValued::Exceptions::BadRange;
{
- $Data::MultiValued::Exceptions::BadRange::VERSION = '0.0.1_1';
+ $Data::MultiValued::Exceptions::BadRange::VERSION = '0.0.1_2';
}
{
$Data::MultiValued::Exceptions::BadRange::DIST = 'Data-MultiValued';
@@ -91,11 +100,52 @@ __END__
=head1 NAME
-Data::MultiValued::Exceptions
+Data::MultiValued::Exceptions - exception classes
=head1 VERSION
-version 0.0.1_1
+version 0.0.1_2
+
+=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.
+
+=head2 C<Data::MultiValued::Exceptions::TagNotFound>
+
+Subclass of L<Data::MultiValued::Exceptions::NotFound>, for
+tags. Stringifies to:
+
+ tag not found: $value
+
+ $stack_trace
+
+=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
+
+=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
=head1 AUTHOR
@@ -103,7 +153,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2011 by Net-a-porter.com.
+This software is copyright (c) 2011 by Net-a-Porter.com.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.