| 1 | package WWW::SFDC::Role::Exception; | ||||||||||
| 2 | # ABSTRACT: Exception role for WWW::SFDC libraries | ||||||||||
| 3 | |||||||||||
| 4 | 5 | ▶ | use 5.12.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 5 | our $VERSION = '0.36'; # TRIAL VERSION | |||||||||
| 9 | |||||||||||
| 10 | 5 | ▶ | use Log::Log4perl ':easy'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 5 | ▶ | use Scalar::Util 'blessed'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 5 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 5 | ▶ | use overload '""' => \&_stringify; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | 5 | has 'message', | |||||||||
| 18 | is => 'ro', | ||||||||||
| 19 | default => 'There was an error in WWW::SFDC'; | ||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | sub _stringify { | ||||||||
|
Subroutine
_stringify: not called CC=1 SCAR=6.9
| |||||||||||
| 22 | 0 | my ($self) = shift; | |||||||||
| 23 | 0 | return $self->message; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub throw { | ||||||||
|
Subroutine
throw: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 28 | 0 | my $self = shift; | |||||||||
| 29 | 0 | ▶ | my $e = blessed $self ? $self : $self->new(@_); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | |||||||||||
| 31 | 0 | FATAL $e; | |||||||||
| 32 | 0 | die $e; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 5 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||