Add stacktrace to internal error report to aid debugging.

This commit is contained in:
Adam Spiers 2012-01-09 21:11:58 +00:00
parent 4dce3d0ce8
commit 5110ea8338

View file

@ -35,7 +35,7 @@ rebuild the target tree.
use strict;
use warnings;
use Carp qw(carp cluck croak confess);
use Carp qw(carp cluck croak confess longmess);
use File::Spec;
use POSIX qw(getcwd);
@ -1964,8 +1964,11 @@ sub do_rmdir {
sub internal_error {
my ($format, @args) = @_;
my $error = sprintf($format, @args);
my $stacktrace = Carp::longmess();
die <<EOF;
$ProgramName: INTERNAL ERROR: $error
$ProgramName: INTERNAL ERROR: $error$stacktrace
This _is_ a bug. Please submit a bug report so we can fix it! :-)
See http://www.gnu.org/software/stow/ for how to do this.
EOF