| 1 | package XAS::Exception; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use base Badger::Exception; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | $Badger::Exception::TRACE = 1; | |||||||||
| 5 | |||||||||||
| 6 | sub stack_trace { | ||||||||||
| 7 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
stack_trace: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 8 | |||||||||||
| 9 | 0 | my @lines; | |||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | if (my $stack = $self->{ stack }) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | |||||||||||
| 13 | 0 | foreach my $caller (@$stack) { | |||||||||
| 14 | |||||||||||
| 15 | # ignore Try::Tiny lines | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | next if (grep( $_ =~ /Try::Tiny/, @$caller )); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | push(@lines, $self->message( caller => @$caller )); | |||||||||
| 19 | |||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | return join("\n", @lines); | |||||||||
| 25 | |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 1 | 1; | |||||||||
| 29 | |||||||||||
| 30 | __END__ | ||||||||||
| 31 | |||||||||||
| 32 | =head1 NAME | ||||||||||
| 33 | |||||||||||
| 34 | XAS::Exception - The base exception class for the XAS environment | ||||||||||
| 35 | |||||||||||
| 36 | =head1 DESCRIPTION | ||||||||||
| 37 | |||||||||||
| 38 | This module defines a base exception class for the XAS Environment and | ||||||||||
| 39 | inherits from L<Badger::Exception|https://metacpan.org/Badger::Exception>. | ||||||||||
| 40 | The only differences is that it turns stack tracing on by default. | ||||||||||
| 41 | |||||||||||
| 42 | =head1 METHODS | ||||||||||
| 43 | |||||||||||
| 44 | =head2 stack_trace | ||||||||||
| 45 | |||||||||||
| 46 | Removes any reference to L<Try::Tiny|https://metacpan.org/pod/Try::Tiny> in the stack trace. | ||||||||||
| 47 | |||||||||||
| 48 | =head1 SEE ALSO | ||||||||||
| 49 | |||||||||||
| 50 | =over 4 | ||||||||||
| 51 | |||||||||||
| 52 | =item L<XAS|XAS> | ||||||||||
| 53 | |||||||||||
| 54 | =back | ||||||||||
| 55 | |||||||||||
| 56 | =head1 AUTHOR | ||||||||||
| 57 | |||||||||||
| 58 | Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt> | ||||||||||
| 59 | |||||||||||
| 60 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 61 | |||||||||||
| 62 | Copyright (C) 2014 Kevin L. Esteb | ||||||||||
| 63 | |||||||||||
| 64 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 65 | the terms of the Artistic License 2.0. For details, see the full text | ||||||||||
| 66 | of the license at http://www.perlfoundation.org/artistic_license_2_0. | ||||||||||
| 67 | |||||||||||
| 68 | =cut | ||||||||||