Enhancement: Make web installer log errors to error log

The web installer should log errors to the error log instead of only
dumping them to the browser. This will allow a record of the errors
which may be useful for later debugging.
This commit is contained in:
Chris Nighswonger 2010-01-13 13:30:31 -05:00
parent ba36655755
commit 7682f493c6
2 changed files with 18 additions and 13 deletions

View file

@ -572,6 +572,9 @@ sub load_sql {
# so that only true errors are returned to stderr or else the installer will
# report the import a failure although it really succeded -fbcit
}
# errors thrown while loading installer data should be logged
warn "C4::Installer::load_sql returned the following errors while attempting to load $filename:\n";
warn $error;
return $error;
}

View file

@ -414,6 +414,8 @@ elsif ( $step && $step == 3 ) {
if (@$stderr_buf) {
$template->param(update_errors => [ map { { line => $_ } } split(/\n/, join('', @$stderr_buf)) ] );
$template->param(has_update_errors => 1);
warn "The following errors were returned while attempting to run the updatedatabase.pl script:\n";
foreach my $line (@$stderr_buf) {warn "$line\n";}
}
$template->param( $op => 1 );