Commit 887f81aa authored by Leigh B Stoller's avatar Leigh B Stoller

Logging changes. 1) Do not treat SEARCHFAILED as an error that needs

an email message. 2) On real errors, stick the libaudit output into
the "output" slot of the GeniResponse structure.
parent 1fa75a45
......@@ -331,9 +331,6 @@ else {
if (GeniResponse::IsError($result)) {
$message .= "Error: " . $result->{'code'} . "\n";
if ($mailerrors) {
print STDERR "Mail Errors is on.\n";
}
}
else {
$message .= "Code: " . $result->{'code'} . "\n";
......@@ -346,6 +343,23 @@ else {
AddAuditInfo("message", $message);
#
# If the response indicates error, and no output is defined in
# the response, then send back the contents of the audit file.
# Not sure this makes any sense at all yet, but the point is to
# get more info back to the user.
#
if (GeniResponse::IsError($result) &&
(!defined($result->{'output'}) || $result->{'output'} eq "") &&
exists($ENV{'TBAUDITLOG'}) && -s $ENV{'TBAUDITLOG'}) {
$result->{'output'} = `cat $ENV{'TBAUDITLOG'}`;
}
# Do this after above so that silly comment is not sent to user.
if (GeniResponse::IsError($result) && $mailerrors &&
$result->{'code'} != GENIRESPONSE_SEARCHFAILED()) {
print STDERR "Mail Errors is on.\n";
}
#
# Added this for geni-am ...
#
......
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