Subject: | Carp Always doesn't suppress duplicate traceback on Carp calls |
Date: | Sun, 22 Oct 2017 03:37:16 -0700 |
To: | bug-Carp-Always [...] rt.cpan.org |
From: | L A Walsh <perl-diddler [...] tlinx.org> |
Usually, I have various places in a program where I either want to die
or warn or do them with a traceback.
So usually I explicitly call Carp::Confess or similar to ask
for a traceback when I know I'll want it, vs. in other cases,
where I've handled the error and use die, to not generate
a traceback (say for a bad switch value).
But during development, sometimes the program dies or issues a warning
and I don't know where it is coming from or how it got there,
so I want full tracebacks on everything -- and toggle on Carp::Always.
This works fairly well, except in places where I'm already
exiting via Confess (and fatal warnings) or croak. In those
cases, Carp::Always generates a double traceback.
It would be helpful to eliminate confusing output by having
Carp::Always suppress its output when a Carp::confess or croak
has already generated a traceback (or is about to -- not sure which
output comes first).
It is very confusing, as it only happens for those errors that
already have a traceback -- and then it appears there is some
weird error loop in the output like in this output:
Use of uninitialized value in subroutine entry at
/home/law/bin/lib/MediaLib2.pm line 276.
MediaStore::ms_scan("MediaStore", HASH(0x114a098)) called at
/home/law/bin/nrss_rdr line 990
main::parse_season_media_wants(main=HASH(0xa0fe70)) called at
/home/law/bin/nrss_rdr line 1054
Use of uninitialized value in subroutine entry at
/home/law/bin/lib/MediaLib2.pm line 276.
MediaStore::ms_scan("MediaStore", HASH(0x114a098)) called at
/home/law/bin/nrss_rdr line 990
main::parse_season_media_wants(main=HASH(0xa0fe70)) called at
/home/law/bin/nrss_rdr line 1054
-----The above was dup'ed in the output, but the next error
doesn't have a dup:
Can't use string ("") as a subroutine ref while "strict refs" in use at
/home/law/bin/lib/MediaLib2.pm line 276.
MediaStore::ms_scan("MediaStore", HASH(0x114a098)) called at
/home/law/bin/nrss_rdr line 990
main::parse_season_media_wants(main=HASH(0xa0fe70)) called at
/home/law/bin/nrss_rdr line 1054
Can get very confusing...
Carp::Always version is 0.13
I don't think perl version matters.
running on x86-64 linux.