Commit | Line | Data |
861c3e27 |
1 | package Text::Tradition::Error; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use Moose; |
6 | use overload '""' => \&_stringify, 'fallback' => 1; |
7 | |
63778331 |
8 | with qw/ Throwable::X StackTrace::Auto /; |
861c3e27 |
9 | use Throwable::X -all; |
10 | |
11 | sub _stringify { |
12 | my $self = shift; |
63778331 |
13 | return "Error: " . $self->ident . " // " . $self->message |
14 | . "\n" . $self->stack_trace->as_string; |
861c3e27 |
15 | } |
16 | |
17 | no Moose; |
63778331 |
18 | __PACKAGE__->meta->make_immutable( inline_constructor => 0 ); |
861c3e27 |
19 | |
20 | =head1 NAME |
21 | |
22 | Text::Tradition::Error - throwable error class for CollateX package |
23 | |
24 | =head1 DESCRIPTION |
25 | |
26 | A basic exception class to throw around, as it were. |
27 | |
027d819c |
28 | =head1 LICENSE |
29 | |
30 | This package is free software and is provided "as is" without express |
31 | or implied warranty. You can redistribute it and/or modify it under |
32 | the same terms as Perl itself. |
861c3e27 |
33 | |
34 | =head1 AUTHOR |
35 | |
36 | Tara L Andrews E<lt>aurum@cpan.orgE<gt> |