Subject: | Empty exception issue |
Hello,
Attached please find a tiny reproduction case for behavior that is contrary to my expectation.
In short, within a try, after a call to the constructor of a particular module, any calls to die will
end up triggering exception handling (correctly) but the argument to die is not being
propagated (not my expectation). Instead, I receive an "empty exception" showing up as literally
" at /path/to/Error.pm line 38."
Needless to say, this can be a particularly troublesome issue within a large system as it
effectively masks a "real error message" thus making debugging far more time-consuming. I'm
not sure if this is a bug in Error or Spreadsheet::WriteExcel or even if my expectations here don't
match yours. Either way, I'd be ever so appreciative if someone could shed any light whatsoever
on this topic.
Thank you!
Subject: | except.pl |
#!/usr/bin/perl -w
use strict;
use Error qw(:try);
use Spreadsheet::WriteExcel::Big;
try {
my $workbook = Spreadsheet::WriteExcel::Big->new("/tmp/foo.$$");
die "Error message successfully propagated!\n";
}
catch Error with {
my $E = shift;
warn "An error occured: |$E|";
# ** The above prints:
# An error occured: | at /path/to/Error.pm line 38.
# | at except.pl line 14.
# ** I expect it to print:
# An error occured: |Error message successfully propagated!
# | at except.pl line 14.
};