| 1 | package Ekahau::ErrHandler; | ||||||||||||||||||||||||||||||||
| 2 | 15 | our $VERSION = '0.001'; | |||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||
| 4 | # Written by Scott Gifford <gifford@umich.edu> | ||||||||||||||||||||||||||||||||
| 5 | # Copyright (C) 2005 The Regents of the University of Michigan. | ||||||||||||||||||||||||||||||||
| 6 | # See the file LICENSE included with the distribution for license | ||||||||||||||||||||||||||||||||
| 7 | # information. | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 15 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 10 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | 15 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||
| 16 | Ekahau::ErrHandler - Internal class used to unify error handling across Ekahau modules | ||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | This class provides consistent error-handling methods across all of | ||||||||||||||||||||||||||||||||
| 21 | the Ekahau classes. It is designed for internal use only, and so is | ||||||||||||||||||||||||||||||||
| 22 | not documented. | ||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | =cut | ||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 15 | ▶ | use constant EHCLASS => 'Ekahau::ErrHandler'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 28 | 15 | ▶ | use constant INTCLASS => EHCLASS.'::Internal'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | sub errhandler_new | ||||||||||||||||||||||||||||||||
| 31 | 62 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
errhandler_new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 32 | 62 | my $class = shift; | |||||||||||||||||||||||||||||||
| 33 | 62 | my($objclass,%p) = @_; | |||||||||||||||||||||||||||||||
| 34 | 62 | ▶ | $objclass | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 35 | or croak "usage: Ekahau::ErrHandler->errhandler_new($class,[%params])"; | ||||||||||||||||||||||||||||||||
| 36 | 62 | my $self = {objclass => $objclass}; | |||||||||||||||||||||||||||||||
| 37 | 62 | bless $self, 'Ekahau::ErrHandler::Internal'; | |||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | # If these are undef defaults will be set | ||||||||||||||||||||||||||||||||
| 40 | 62 | $self->set_errhandler($p{ErrorHandler}); | |||||||||||||||||||||||||||||||
| 41 | 62 | $self->set_errholder($p{ErrorHolder}); | |||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||
| 43 | 62 | $self; | |||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||
| 46 | sub errhandler_constructed | ||||||||||||||||||||||||||||||||
| 47 | 82 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
errhandler_constructed: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 48 | 82 | my $self = shift; | |||||||||||||||||||||||||||||||
| 49 | 82 | ▶ | my $errobj = $self->ERROBJ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 50 | or croak "Couldn't get error object from $self"; | ||||||||||||||||||||||||||||||||
| 51 | 82 | $errobj->errhandler_constructed(@_); | |||||||||||||||||||||||||||||||
| 52 | 82 | $self; | |||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | sub errhandler_deconstructed | ||||||||||||||||||||||||||||||||
| 56 | 28 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
errhandler_deconstructed: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 57 | 28 | my $self = shift; | |||||||||||||||||||||||||||||||
| 58 | 28 | ▶ | my $errobj = $self->ERROBJ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 59 | or croak "Couldn't get error object from $self"; | ||||||||||||||||||||||||||||||||
| 60 | 28 | $errobj->errhandler_constructed(@_); | |||||||||||||||||||||||||||||||
| 61 | 28 | $self; | |||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||
| 64 | sub set_errhandler | ||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
set_errhandler: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 66 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | if (ref $self) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 68 | { | ||||||||||||||||||||||||||||||||
| 69 | # Object | ||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | my $errobj = $self->ERROBJ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 71 | or croak "Couldn't get error object from $self"; | ||||||||||||||||||||||||||||||||
| 72 | 0 | return $errobj->set_errhandler(@_); | |||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||
| 74 | else | ||||||||||||||||||||||||||||||||
| 75 | { | ||||||||||||||||||||||||||||||||
| 76 | 0 | return Ekahau::ErrHandler::Internal->class_errhandler($self,@_); | |||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||
| 80 | sub set_errholder | ||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
set_errholder: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 82 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | if (ref $self) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 84 | { | ||||||||||||||||||||||||||||||||
| 85 | # Object | ||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | my $errobj = $self->ERROBJ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 87 | or croak "Couldn't get error object from $self"; | ||||||||||||||||||||||||||||||||
| 88 | 0 | return $errobj->set_errholder(@_); | |||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||
| 90 | else | ||||||||||||||||||||||||||||||||
| 91 | { | ||||||||||||||||||||||||||||||||
| 92 | 0 | return Ekahau::ErrHandler::Internal->class_errholder($self,@_); | |||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||
| 96 | sub reterr | ||||||||||||||||||||||||||||||||
| 97 | 211 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
reterr: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 98 | 211 | my $self = shift; | |||||||||||||||||||||||||||||||
| 99 | 211 | ▶ | my $errobj = $self->ERROBJ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 100 | or croak "Couldn't get error object from $self"; | ||||||||||||||||||||||||||||||||
| 101 | 211 | $errobj->reterr(@_); | |||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||
| 104 | sub lasterr | ||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
lasterr: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 106 | 0 | my $arg = shift; | |||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | if (ref $arg) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 108 | { | ||||||||||||||||||||||||||||||||
| 109 | # Object | ||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | my $errobj = $arg->ERROBJ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 111 | or croak "Couldn't get error object from '$arg'"; | ||||||||||||||||||||||||||||||||
| 112 | 0 | return $errobj->lasterr(@_); | |||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||
| 114 | else | ||||||||||||||||||||||||||||||||
| 115 | { | ||||||||||||||||||||||||||||||||
| 116 | 0 | return Ekahau::ErrHandler::Internal->last_classerr($arg); | |||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||
| 120 | # Alias for lasterr. | ||||||||||||||||||||||||||||||||
| 121 | sub lasterror | ||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
lasterror: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 123 | 0 | goto &lasterr; | |||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||
| 126 | package Ekahau::ErrHandler::Internal; | ||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||
| 128 | 15 | ▶ | use constant EHCLASS => Ekahau::ErrHandler::EHCLASS; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 129 | 15 | ▶ | use constant INTCLASS => Ekahau::ErrHandler::INTCLASS; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||
| 131 | 15 | our %class_errstr; | |||||||||||||||||||||||||||||||
| 132 | 15 | our %classdefs; | |||||||||||||||||||||||||||||||
| 133 | 15 | our %defs; | |||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||
| 135 | sub errhandler_constructed | ||||||||||||||||||||||||||||||||
| 136 | 110 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
errhandler_constructed: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||
| 137 | 110 | my $self = shift; | |||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||
| 139 | 110 | $self->{constructed} = 1; | |||||||||||||||||||||||||||||||
| 140 | $self->set_errholder(undef) | ||||||||||||||||||||||||||||||||
| 141 | 110 | ▶ | unless (!$self->{custom_errstr}); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||
| 144 | sub errhandler_deconstructed | ||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
errhandler_deconstructed: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||
| 146 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||
| 148 | 0 | $self->{constructed} = 0; | |||||||||||||||||||||||||||||||
| 149 | $self->set_errholder(undef) | ||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | unless (!$self->{custom_errstr}); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||
| 155 | sub set_errhandler | ||||||||||||||||||||||||||||||||
| 156 | 62 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
set_errhandler: called CC=6 SCAR=23.5
| |||||||||||||||||||||||||||||||||
| 157 | 62 | my $self = shift; | |||||||||||||||||||||||||||||||
| 158 | 62 | my($handler)=@_; | |||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||
| 160 | 62 | ▶ | if ($handler) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 161 | { | ||||||||||||||||||||||||||||||||
| 162 | 0 | $self->{handler} = $handler; | |||||||||||||||||||||||||||||||
| 163 | 0 | $self->{custom_handler} = 1; | |||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||
| 165 | else | ||||||||||||||||||||||||||||||||
| 166 | { | ||||||||||||||||||||||||||||||||
| 167 | 62 | ▶ | if ($classdefs{$self->{objclass}} and $classdefs{$self->{objclass}}{handler}) | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
$Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}} and $Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}}{"handler"}
MC/DC0%0/2
$Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}} and $Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}}{"handler"}
$Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}}
$Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}}{"handler"}
Truth table33%1/3
A and B
A= $Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}}B= $Ekahau::ErrHandler::Internal::classdefs{$self->{"objclass"}}{"handler"}
| |||||||||||||||||||||||||||||||||
| 168 | { | ||||||||||||||||||||||||||||||||
| 169 | 0 | $self->{handler} = $classdefs{$self->{objclass}}{handler}; | |||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||
| 171 | ▶ | elsif ($classdefs{EHCLASS()} and $classdefs{EHCLASS()}{handler}) | |||||||||||||||||||||||||||||||
|
Condition33%1/3
$Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"} and $Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"}{"handler"}
MC/DC0%0/2
$Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"} and $Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"}{"handler"}
$Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"}
$Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"}{"handler"}
Truth table33%1/3
A and B
A= $Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"}B= $Ekahau::ErrHandler::Internal::classdefs{"Ekahau::ErrHandler"}{"handler"}
| |||||||||||||||||||||||||||||||||
| 172 | { | ||||||||||||||||||||||||||||||||
| 173 | 0 | $self->{handler} = $classdefs{EHCLASS()}{handler}; | |||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||
| 175 | else | ||||||||||||||||||||||||||||||||
| 176 | { | ||||||||||||||||||||||||||||||||
| 177 | 62 | $self->{handler} =\&default_errhandler; | |||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||
| 179 | 62 | $self->{custom_handler} = 0; | |||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||
| 183 | sub set_errholder | ||||||||||||||||||||||||||||||||
| 184 | 62 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
set_errholder: called CC=4 SCAR=15.0
| |||||||||||||||||||||||||||||||||
| 185 | 62 | my $self = shift; | |||||||||||||||||||||||||||||||
| 186 | 62 | my($holder)=@_; | |||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||
| 188 | 62 | ▶ | if ($holder) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 189 | { | ||||||||||||||||||||||||||||||||
| 190 | 0 | $self->{errstr} = $holder; | |||||||||||||||||||||||||||||||
| 191 | 0 | $self->{custom_errstr} = 1; | |||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||
| 193 | else | ||||||||||||||||||||||||||||||||
| 194 | { | ||||||||||||||||||||||||||||||||
| 195 | 62 | ▶ | if ($self->{constructed}) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 196 | { | ||||||||||||||||||||||||||||||||
| 197 | # Construct a lexical scalar | ||||||||||||||||||||||||||||||||
| 198 | 0 | my $errstr = "unknown error"; | |||||||||||||||||||||||||||||||
| 199 | 0 | $self->{errstr} = \$errstr; | |||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||
| 201 | else | ||||||||||||||||||||||||||||||||
| 202 | { | ||||||||||||||||||||||||||||||||
| 203 | 62 | ▶ | if (!$class_errstr{$self->{objclass}}) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 204 | { | ||||||||||||||||||||||||||||||||
| 205 | 27 | my $errstr = "unknown error"; | |||||||||||||||||||||||||||||||
| 206 | 27 | $class_errstr{$self->{objclass}} = \$errstr; | |||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||
| 208 | 62 | $self->{errstr} = $class_errstr{$self->{objclass}}; | |||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||
| 211 | 62 | $self->{custom_errstr} = 0; | |||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||
| 215 | sub reterr | ||||||||||||||||||||||||||||||||
| 216 | 211 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
reterr: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 217 | 211 | my $self = shift; | |||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||
| 219 | 211 | $self->{handler}->($self,@_); | |||||||||||||||||||||||||||||||
| 220 | 211 | undef; | |||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||
| 223 | sub lasterr | ||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
lasterr: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 225 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 226 | 0 | return ${$self->{errstr}}; | |||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||
| 229 | sub last_classerr | ||||||||||||||||||||||||||||||||
| 230 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
last_classerr: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 231 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||
| 232 | 0 | my($objclass)=@_; | |||||||||||||||||||||||||||||||
| 233 | 0 | return ${$class_errstr{$objclass}}; | |||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||
| 236 | sub default_errhandler | ||||||||||||||||||||||||||||||||
| 237 | 211 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
default_errhandler: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||
| 238 | 211 | my $self = shift; | |||||||||||||||||||||||||||||||
| 239 | 211 | my $errmsg = join("",@_); | |||||||||||||||||||||||||||||||
| 240 | 211 | my $errholder = $self->{errstr}; | |||||||||||||||||||||||||||||||
| 241 | 211 | ▶ | ref $errholder | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 242 | or die "Fatal error handling non-fatal error: $errmsg"; | ||||||||||||||||||||||||||||||||
| 243 | 211 | $$errholder = $errmsg; | |||||||||||||||||||||||||||||||
| 244 | 211 | 1; | |||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||
| 247 | sub class_errholder | ||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
class_errholder: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 249 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||
| 250 | 0 | my($objclass,$holder)=@_; | |||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||
| 252 | 0 | $classdefs{$objclass}{holder}=$holder; | |||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||
| 255 | sub class_errhandler | ||||||||||||||||||||||||||||||||
| 256 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
class_errhandler: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 257 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||
| 258 | 0 | my($objclass,$handler)=@_; | |||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||
| 260 | 0 | $classdefs{$objclass}{handler}=$handler; | |||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||
| 263 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||
| 265 | Scott Gifford E<lt>gifford@umich.eduE<gt>, E<lt>sgifford@suspectclass.comE<gt> | ||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||
| 267 | Copyright (C) 2005 The Regents of the University of Michigan. | ||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||
| 269 | See the file LICENSE included with the distribution for license | ||||||||||||||||||||||||||||||||
| 270 | information. | ||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||
| 272 | =cut | ||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||
| 275 | 15 | 1; | |||||||||||||||||||||||||||||||