package Data::MultiValued::Exceptions;
{
$Data::MultiValued::Exceptions::VERSION = '0.0.1_4';
}
{
$Data::MultiValued::Exceptions::DIST = 'Data-MultiValued';
}
package Data::MultiValued::Exceptions::NotFound;
{
$Data::MultiValued::Exceptions::NotFound::VERSION = '0.0.1_4';
}
{
$Data::MultiValued::Exceptions::NotFound::DIST = 'Data-MultiValued';
}{
use Moose;
with 'Throwable';
use overload
q{""} => 'as_string',
fallback => 1;
has message => (
is => 'ro',
required => 1,
);
has value => (
is => 'ro',
required => 1,
);
sub as_string {
my ($self) = @_;
my $str = $self->message . ($self->value // '<undef>');
return $str;
}
}
package Data::MultiValued::Exceptions::TagNotFound;
{
$Data::MultiValued::Exceptions::TagNotFound::VERSION = '0.0.1_4';
}
{
$Data::MultiValued::Exceptions::TagNotFound::DIST = 'Data-MultiValued';
}{
use Moose;
extends 'Data::MultiValued::Exceptions::NotFound';
has '+message' => (
default => 'tag not found: ',
);
}
package Data::MultiValued::Exceptions::RangeNotFound;
{
$Data::MultiValued::Exceptions::RangeNotFound::VERSION = '0.0.1_4';
}
{
$Data::MultiValued::Exceptions::RangeNotFound::DIST = 'Data-MultiValued';
}{
use Moose;
extends 'Data::MultiValued::Exceptions::NotFound';
has '+message' => (
default => 'no range found for value: ',
);
}
package Data::MultiValued::Exceptions::BadRange;
{
$Data::MultiValued::Exceptions::BadRange::VERSION = '0.0.1_4';
}
{
$Data::MultiValued::Exceptions::BadRange::DIST = 'Data-MultiValued';
}{
use Moose;
with 'Throwable';
use overload
q{""} => 'as_string',
fallback => 1;
has ['from','to'] => ( is => 'ro', required => 1 );
sub as_string {
my ($self) = @_;
my $str = 'invalid range: ' . $self->from . ', ' . $self->to;
return $str;
}
}
1;
__END__