| 1 | package Enbld::Error; | ||
| 2 | |||
| 3 | 12 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 12 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 12 | ▶ | use overload ( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 12 | q{""} => 'to_string', | |
| 8 | fallback => 1, | ||
| 9 | 12 | ); | |
| 10 | |||
| 11 | 12 | ▶ | sub throw { |
|
Subroutine
throw: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 12 | 12 | my ( $class, $message ) = @_; | |
| 13 | |||
| 14 | 12 | die $class->new( $message ); | |
| 15 | } | ||
| 16 | |||
| 17 | 17 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 18 | 17 | my ( $class, $message ) = @_; | |
| 19 | |||
| 20 | 17 | chomp( $message ); | |
| 21 | |||
| 22 | 17 | my $self = { | |
| 23 | message => $message, | ||
| 24 | }; | ||
| 25 | |||
| 26 | 17 | return bless $self, $class; | |
| 27 | } | ||
| 28 | |||
| 29 | 16 | ▶ | sub to_string { |
|
Subroutine
to_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 30 | 16 | my $self = shift; | |
| 31 | |||
| 32 | 16 | return "ERROR:$self->{message}\n"; | |
| 33 | } | ||
| 34 | |||
| 35 | 12 | 1; | |