diff options
Diffstat (limited to 'Data-MultiValued/lib/Data/MultiValued/Exceptions.pm')
-rw-r--r-- | Data-MultiValued/lib/Data/MultiValued/Exceptions.pm | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Data-MultiValued/lib/Data/MultiValued/Exceptions.pm b/Data-MultiValued/lib/Data/MultiValued/Exceptions.pm deleted file mode 100644 index 8d444c0..0000000 --- a/Data-MultiValued/lib/Data/MultiValued/Exceptions.pm +++ /dev/null @@ -1,57 +0,0 @@ -package Data::MultiValued::Exceptions; -package Data::MultiValued::Exceptions::NotFound;{ -use Moose; -extends 'Throwable::Error'; - -has value => ( - is => 'ro', - required => 1, -); - -sub as_string { - my ($self) = @_; - - my $str = $self->message . ($self->value // '<undef>'); - $str .= "\n\n" . $self->stack_trace->as_string; - - return $str; -} - -} -package Data::MultiValued::Exceptions::TagNotFound;{ -use Moose; -extends 'Data::MultiValued::Exceptions::NotFound'; - -has '+message' => ( - default => 'tag not found: ', -); -} -package Data::MultiValued::Exceptions::RangeNotFound;{ -use Moose; -extends 'Data::MultiValued::Exceptions::NotFound'; - -has '+message' => ( - default => 'no range found for value ', -); -} -package Data::MultiValued::Exceptions::BadRange;{ -use Moose; -extends 'Throwable::Error'; - -has ['from','to'] => ( is => 'ro', required => 1 ); -has '+message' => ( - default => 'invalid range: ', -); - -sub as_string { - my ($self) = @_; - - my $str = $self->message . $self->from . ', ' . $self->to; - $str .= "\n\n" . $self->stack_trace->as_string; - - return $str; -} - -} - -1; |