Commit af64f322 authored by sikeda's avatar sikeda
Browse files

[-dev] Introducing "css_update_failed" type for mail_tt2/listmater_notification.tt2.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12411 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent f1d7ce63
......@@ -79,6 +79,20 @@ Subject: [% FILTER qencode %][%|loc%]CSS files have been updated[%END%][%END%]
[%|loc%]Static CSS files have been updated. Check log file for details.[%END%]
[% ELSIF type == 'css_update_failed' -%]
Subject: [%|qencode%][%|loc%]CSS update failed[%END%][%END%]
[%|loc%]Static CSS failed updating.[%END%]
[% IF error == 'cannot_mkdir' -%]
[%|loc(target,message)%]Cannot make directory %1: %2.[%END -%]
[% ELSIF error == 'cannot_open_file' -%]
[%|loc(file,message)%]Cannot open file %1: %2.[%END -%]
[% ELSIF error == 'tt2_error' -%]
[%|loc(message)%]Parsing template failed: %1.[%END -%]
[% ELSE -%]
[%|loc%]Unknown error.[%END -%]
[%END %]
[% ELSIF type == 'db_restored' -%]
Subject: [% FILTER qencode %][%|loc%]DataBase connection restored[%END%][%END%]
......
......@@ -947,8 +947,14 @@ sub update_css {
if (@$error) {
my ($target, $err) = %{$error->[-1] || {}};
Sympa::send_notify_to_listmaster($robot, 'cannot_mkdir',
["Could not create $target: $err"]);
Sympa::send_notify_to_listmaster(
$robot,
'css_update_failed',
{ error => 'cannot_mkdir',
target => $target,
message => $err
}
);
$log->syslog('err', 'Failed to create %s: %s', $target, $err);
umask $umask;
......@@ -987,9 +993,14 @@ sub update_css {
unless (open CSS, '>', $dir . '/' . $css) {
my $errno = $ERRNO;
Sympa::send_notify_to_listmaster($robot,
'cannot_open_file',
["Could not open file $dir/$css: $errno"]);
Sympa::send_notify_to_listmaster(
$robot,
'css_update_failed',
{ error => 'cannot_open_file',
file => "$dir/$css",
message => $errno,
}
);
$log->syslog('err',
'Failed to open (write) file %s/%s: %s',
$dir, $css, $errno);
......@@ -1003,9 +1014,9 @@ sub update_css {
unless ($css_template->parse($param, 'css.tt2', \*CSS)) {
my $error = $css_template->{last_error};
$error = $error->as_string if ref $error;
$param->{'tt2_error'} = $error;
Sympa::send_notify_to_listmaster($robot, 'web_tt2_error',
[$error]);
Sympa::send_notify_to_listmaster($robot,
'css_update_failed',
{error => 'tt2_error', message => $error});
$log->syslog('err', 'Error while installing %s/%s',
$dir, $css);
}
......
Supports Markdown
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