Commit 35fea206 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add stack backtrace to DBError() email message to tbops.

parent 983ddd06
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group. # Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
package emdb; package emdb;
use strict; use strict;
use File::Basename; use File::Basename;
use English; use English;
use Carp;
use Exporter; use Exporter;
use vars qw(@ISA @EXPORT); use vars qw(@ISA @EXPORT);
@ISA = "Exporter"; @ISA = "Exporter";
...@@ -66,7 +67,8 @@ sub DBError($$;$) ...@@ -66,7 +67,8 @@ sub DBError($$;$)
if (! defined($nomail)) { if (! defined($nomail)) {
libtestbed::SENDMAIL($TBOPS, "DBError - $message", libtestbed::SENDMAIL($TBOPS, "DBError - $message",
"$message - In $SCRIPTNAME\n". "$message - In $SCRIPTNAME\n".
"$emdbi::DBErrorString\n"); "$emdbi::DBErrorString\n" .
Carp::longmess() . "\n");
} }
$f->({cause=>'software'}, "$message:\n$emdbi::DBErrorString"); $f->({cause=>'software'}, "$message:\n$emdbi::DBErrorString");
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group. # Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
package emdbi; package emdbi;
...@@ -9,6 +9,7 @@ use strict; ...@@ -9,6 +9,7 @@ use strict;
use File::Basename; use File::Basename;
use Mysql; use Mysql;
use English; use English;
use Carp;
use Exporter; use Exporter;
use vars qw(@ISA @EXPORT); use vars qw(@ISA @EXPORT);
@ISA = "Exporter"; @ISA = "Exporter";
...@@ -393,6 +394,8 @@ sub DBError($$;$) ...@@ -393,6 +394,8 @@ sub DBError($$;$)
print MAIL "In $SCRIPTNAME\n\n"; print MAIL "In $SCRIPTNAME\n\n";
print MAIL "$message\n\n"; print MAIL "$message\n\n";
print MAIL "$DBErrorString\n\n"; print MAIL "$DBErrorString\n\n";
print MAIL Carp::longmess();
print MAIL "\n";
close(MAIL); close(MAIL);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment