summaryrefslogtreecommitdiff
path: root/Data-TagsAndRanges/lib/Data/TagsAndRanges/Exceptions.pm
blob: c28824be6f4bddd35ee223ae18f96cd8da00185e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package Data::TagsAndRanges::Exceptions; 
package Data::TagsAndRanges::Exceptions::NotFound;{ 
use Moose;
extends 'Throwable::Error';
 
has value => (
    is => 'ro',
    required => 1,
);
 
sub as_string {
    my ($self) = @_;
 
    my $str = $self->message . $self->value;
    $str .= "\n\n" . $self->stack_trace->as_string;
 
    return $str;
}
 
}
package Data::TagsAndRanges::Exceptions::TagNotFound;{ 
use Moose;
extends 'Data::TagsAndRanges::Exceptions::NotFound';
 
has '+message' => (
    default => 'tag not found: ',
);
}
package Data::TagsAndRanges::Exceptions::RangeNotFound;{ 
use Moose;
extends 'Data::TagsAndRanges::Exceptions::NotFound';
 
has '+message' => (
    default => 'no range found for value ',
);
}
 
1;