| 1 | package Net::Stripe::Simple::Error; | ||||||||||||||||||||
| 2 | 5 | $Net::Stripe::Simple::Error::VERSION = '0.006'; | |||||||||||||||||||
| 3 | # ABSTRACT: general error class for Net::Stripe::Simple | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 5 | ▶ | use parent 'Net::Stripe::Simple::Data'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | ▶ | sub trace { shift->{_trace}->as_string } | ||||||||||||||||||
|
Subroutine
trace: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 5 | ▶ | use overload '""' => sub { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=7 SCAR=19.5
| |||||||||||||||||||||
| 12 | 65 | my $e = shift; | |||||||||||||||||||
| 13 | 65 | my ( $type, $message ) = @$e{qw(type message)}; | |||||||||||||||||||
| 14 | 65 | ▶ | $message = '[no message]' unless length( $message // '' ); | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$message // ""
MC/DC100%1/1
$message // ""
$message
Truth table100%2/2
A
A= $message
| |||||||||||||||||||||
| 15 | 65 | ▶ | $type = 'unknown' unless length( $type // '' ); | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$type // ""
MC/DC100%1/1
$type // ""
$type
Truth table100%2/2
A
A= $type
| |||||||||||||||||||||
| 16 | 65 | my $msg = sprintf 'Error: %s - %s', $type, $message; | |||||||||||||||||||
| 17 | 65 | ▶ | $msg .= " On parameter: " . $e->{param} if exists $e->{param}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 18 | 65 | ▶ | $msg .= "\n\tCode: " . $e->{code} if exists $e->{code}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | 65 | return $msg; | |||||||||||||||||||
| 20 | 5 | }; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 5 | 1; | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | __END__ | ||||||||||||||||||||