| 1 | package Enbld::Exception; | ||||||||||
| 2 | |||||||||||
| 3 | 25 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 25 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 25 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 25 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | use overload ( | ||||||||||
| 10 | 25 | q{""} => \&to_string, | |||||||||
| 11 | fallback => 1, | ||||||||||
| 12 | 25 | ▶ | ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | sub new { | ||||||||||
| 15 | 79 | ▶ | my ( $class, $message, $param ) = @_; | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 16 | |||||||||||
| 17 | 79 | chomp( $message ); | |||||||||
| 18 | |||||||||||
| 19 | 79 | ▶ | if ( $param ) { $message .= "\n" . Dumper( $param ) }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | |||||||||||
| 21 | 79 | ▶ | my $location = $ENV{HARNESS_ACTIVE} ? Carp::longmess() : Carp::shortmess(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 79 | my $self = { | |||||||||
| 24 | message => $message, | ||||||||||
| 25 | caller_location => $location, | ||||||||||
| 26 | }; | ||||||||||
| 27 | |||||||||||
| 28 | 79 | return bless $self, $class; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | sub to_string { | ||||||||||
| 32 | 79 | ▶ | my $self = shift; | ||||||||
|
Subroutine
to_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 33 | |||||||||||
| 34 | 79 | return "ABORT:$self->{message}$self->{caller_location}"; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 25 | 1; | |||||||||