| 1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||||||||||||||
| 2 | # vim: ts=4 sts=4 sw=4: | ||||||||||||||
| 3 | package CPAN::Exception::yaml_process_error; | ||||||||||||||
| 4 | 26 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 26 | ▶ | use overload '""' => "as_string"; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | |||||||||||||||
| 7 | 26 | ▶ | use vars qw( | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | $VERSION | ||||||||||||||
| 9 | 26 | ); | |||||||||||||
| 10 | 26 | $VERSION = "5.5"; | |||||||||||||
| 11 | |||||||||||||||
| 12 | |||||||||||||||
| 13 | 0 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 14 | 0 | ▶ | my($class,$module,$file,$during,$error) = @_; | ||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 15 | # my $at = Carp::longmess(""); # XXX find something more beautiful | ||||||||||||||
| 16 | 0 | bless { module => $module, | |||||||||||||
| 17 | file => $file, | ||||||||||||||
| 18 | during => $during, | ||||||||||||||
| 19 | error => $error, | ||||||||||||||
| 20 | # at => $at, | ||||||||||||||
| 21 | }, $class; | ||||||||||||||
| 22 | } | ||||||||||||||
| 23 | |||||||||||||||
| 24 | 0 | ▶ | sub as_string { | ||||||||||||
|
Subroutine
as_string: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||
| 25 | 0 | ▶ | my($self) = shift; | ||||||||||||
|
Subroutine
as_string: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||
| 26 | 0 | ▶ | if ($self->{during}) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 27 | 0 | ▶ | if ($self->{file}) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 28 | 0 | ▶ | if ($self->{module}) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 29 | 0 | ▶ | if ($self->{error}) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 30 | 0 | return "Alert: While trying to '$self->{during}' YAML file\n". | |||||||||||||
| 31 | " '$self->{file}'\n". | ||||||||||||||
| 32 | "with '$self->{module}' the following error was encountered:\n". | ||||||||||||||
| 33 | " $self->{error}\n"; | ||||||||||||||
| 34 | } else { | ||||||||||||||
| 35 | 0 | return "Alert: While trying to '$self->{during}' YAML file\n". | |||||||||||||
| 36 | " '$self->{file}'\n". | ||||||||||||||
| 37 | "with '$self->{module}' some unknown error was encountered\n"; | ||||||||||||||
| 38 | } | ||||||||||||||
| 39 | } else { | ||||||||||||||
| 40 | 0 | return "Alert: While trying to '$self->{during}' YAML file\n". | |||||||||||||
| 41 | " '$self->{file}'\n". | ||||||||||||||
| 42 | "some unknown error was encountered\n"; | ||||||||||||||
| 43 | } | ||||||||||||||
| 44 | } else { | ||||||||||||||
| 45 | 0 | return "Alert: While trying to '$self->{during}' some YAML file\n". | |||||||||||||
| 46 | "some unknown error was encountered\n"; | ||||||||||||||
| 47 | } | ||||||||||||||
| 48 | } else { | ||||||||||||||
| 49 | 0 | return "Alert: unknown error encountered\n"; | |||||||||||||
| 50 | } | ||||||||||||||
| 51 | } | ||||||||||||||
| 52 | |||||||||||||||
| 53 | 26 | 1; | |||||||||||||