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