| 1 | package Praxo::Errors; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Exporter 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | our @EXPORT_OK = qw(praxo_error error_code); | |||||||||
| 8 | |||||||||||
| 9 | 0 | ▶ | sub praxo_error { | ||||||||
|
Subroutine
praxo_error: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 10 | 0 | my ($code, $message) = @_; | |||||||||
| 11 | 0 | die bless { code => $code, message => $message }, 'Praxo::Errors::Error'; | |||||||||
| 12 | } | ||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub error_code { | ||||||||
|
Subroutine
error_code: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 15 | 0 | my ($error) = @_; | |||||||||
| 16 | 0 | ▶ | return ref($error) eq 'Praxo::Errors::Error' ? $error->{code} : ''; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | package Praxo::Errors::Error; | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | use overload '""' => sub { $_[0]->{message} }, fallback => 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
Subroutine
__ANON__: not called CC=1 SCAR=0.2
| |||||||||||
| 22 | |||||||||||
| 23 | 1 | 1; | |||||||||