13
sub fatal { die __PACKAGE__ . ": Can't handle '$_[3]'" }
15
# normally the object is created on the C side, but if you want to
16
# create one from Perl, you can. just pass a hash with args:
17
# rc, file, line, func
25
sprintf "%s: %s at %s line %d", $_[0]->{func},
26
APR::Error::strerror($_[0]->{rc}),
27
$_[0]->{file}, $_[0]->{line};
30
sub num { $_[0]->{rc} }
32
# skip the wrappers from this package from the long callers trace
33
$Carp::CarpInternal{+__PACKAGE__}++;
35
# XXX: Carp::(confess|cluck) see no calls stack when Perl_croak is
36
# called with Nullch (which is the way execption objects are
37
# returned), so we fixup it here (doesn't quite work for croak
40
if (ref $_[0] eq __PACKAGE__) {
41
Carp::cluck("$_[0]->{func}: " .
42
APR::Error::strerror($_[0]->{rc}));
50
if (ref $_[0] eq __PACKAGE__) {
51
Carp::confess("$_[0]->{func}: " .
52
APR::Error::strerror($_[0]->{rc}));