Bug 58633
Rework Bugzilla internal error handling git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@605 6955db30-a419-402b-8a0d-67ecbb4d7f56master
parent
c59d7c7cbc
commit
4a02af6c8b
33
Bugzilla.pm
33
Bugzilla.pm
|
@ -26,15 +26,6 @@ package Bugzilla;
|
|||
|
||||
use strict;
|
||||
|
||||
# We want any compile errors to get to the browser, if possible.
|
||||
BEGIN {
|
||||
# This makes sure we're in a CGI.
|
||||
if ($ENV{SERVER_SOFTWARE} && !$ENV{MOD_PERL}) {
|
||||
require CGI::Carp;
|
||||
CGI::Carp->import('fatalsToBrowser');
|
||||
}
|
||||
}
|
||||
|
||||
use Bugzilla::Config;
|
||||
use Bugzilla::Constants;
|
||||
use Bugzilla::Auth;
|
||||
|
@ -56,6 +47,30 @@ use DateTime::TimeZone;
|
|||
use Safe;
|
||||
use Encode::MIME::Header ();
|
||||
|
||||
# We want any compile errors to get to the browser, if possible.
|
||||
BEGIN {
|
||||
$SIG{__DIE__} = sub
|
||||
{
|
||||
if (ref($_[0]) eq 'Bugzilla::Error')
|
||||
{
|
||||
die($_[0]->{message});
|
||||
}
|
||||
else
|
||||
{
|
||||
my $msg = $_[0];
|
||||
$msg =~ s/\s*$//so;
|
||||
$msg = { eval_error => $msg };
|
||||
if (eval { require Devel::StackTrace; })
|
||||
{
|
||||
# Append stack trace if Devel::StackTrace is available
|
||||
$msg->{stack_trace} = Devel::StackTrace->new->as_string;
|
||||
}
|
||||
Bugzilla::Error::ThrowCodeError('eval_error', $msg);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# This creates the request cache for non-mod_perl installations.
|
||||
our $_request_cache = {};
|
||||
|
||||
|
|
|
@ -46,6 +46,24 @@ sub get_param_list {
|
|||
default => 'THE MAINTAINER HAS NOT YET BEEN SET'
|
||||
},
|
||||
|
||||
{
|
||||
name => 'error_log',
|
||||
type => 't',
|
||||
default => 'errorlog',
|
||||
},
|
||||
|
||||
{
|
||||
name => 'report_code_errors_to_maintainer',
|
||||
type => 'b',
|
||||
default => 1,
|
||||
},
|
||||
|
||||
{
|
||||
name => 'report_user_errors_to_maintainer',
|
||||
type => 'b',
|
||||
default => 0,
|
||||
},
|
||||
|
||||
{
|
||||
name => 'urlbase',
|
||||
type => 't',
|
||||
|
@ -74,7 +92,6 @@ sub get_param_list {
|
|||
default => 'never'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
name => 'cookiedomain',
|
||||
type => 't',
|
||||
|
|
|
@ -31,8 +31,12 @@ use base qw(Exporter);
|
|||
use Bugzilla::Constants;
|
||||
use Bugzilla::WebService::Constants;
|
||||
use Bugzilla::Util;
|
||||
use Bugzilla::Mailer;
|
||||
use Date::Format;
|
||||
use JSON;
|
||||
use Data::Dumper;
|
||||
|
||||
use overload '""' => sub { $_[0]->{message} };
|
||||
|
||||
# We cannot use $^S to detect if we are in an eval(), because mod_perl
|
||||
# already eval'uates everything, so $^S = 1 in all cases under mod_perl!
|
||||
|
@ -45,64 +49,96 @@ sub _in_eval {
|
|||
return $in_eval;
|
||||
}
|
||||
|
||||
sub _throw_error {
|
||||
my ($name, $error, $vars) = @_;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
$vars ||= {};
|
||||
# build error message for printing into error log or sending to maintainer e-mail
|
||||
sub _error_message
|
||||
{
|
||||
my ($type, $error, $vars) = @_;
|
||||
my $mesg = '';
|
||||
$mesg .= "[$$] " . time2str("%D %H:%M:%S ", time());
|
||||
$mesg .= uc($type)." $error ";
|
||||
$mesg .= "$ENV{REMOTE_ADDR}" if $ENV{REMOTE_ADDR};
|
||||
if (Bugzilla->user)
|
||||
{
|
||||
$mesg .= ' ' . Bugzilla->user->login;
|
||||
$mesg .= (' actually ' . Bugzilla->sudoer->login) if Bugzilla->sudoer;
|
||||
}
|
||||
$mesg .= "\n";
|
||||
$Data::Dumper::Indent = 1;
|
||||
$mesg .= Data::Dumper->Dump([$vars, { Bugzilla->cgi->Vars }, { %ENV }], ['error_vars', 'cgi_params', 'env']);
|
||||
# ugly workaround for Data::Dumper's \x{425} unicode characters
|
||||
$mesg =~ s/((?:\\x\{(?:[\dA-Z]+)\})+)/eval("\"$1\"")/egiso;
|
||||
return $mesg;
|
||||
}
|
||||
|
||||
sub _throw_error
|
||||
{
|
||||
my ($type, $error, $vars) = @_;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
$vars ||= {};
|
||||
$vars->{error} = $error;
|
||||
my $mode = Bugzilla->error_mode;
|
||||
|
||||
# Make sure any transaction is rolled back (if supported).
|
||||
# If we are within an eval(), do not roll back transactions as we are
|
||||
# eval'uating some test on purpose.
|
||||
$dbh->bz_rollback_transaction() if ($dbh->bz_in_transaction() && !_in_eval());
|
||||
|
||||
my $datadir = bz_locations()->{'datadir'};
|
||||
# If a writable $datadir/errorlog exists, log error details there.
|
||||
if (-w "$datadir/errorlog") {
|
||||
require Data::Dumper;
|
||||
my $mesg = "";
|
||||
for (1..75) { $mesg .= "-"; };
|
||||
$mesg .= "\n[$$] " . time2str("%D %H:%M:%S ", time());
|
||||
$mesg .= "$name $error ";
|
||||
$mesg .= "$ENV{REMOTE_ADDR} " if $ENV{REMOTE_ADDR};
|
||||
$mesg .= Bugzilla->user->login;
|
||||
$mesg .= (' actually ' . Bugzilla->sudoer->login) if Bugzilla->sudoer;
|
||||
$mesg .= "\n";
|
||||
my %params = Bugzilla->cgi->Vars;
|
||||
$Data::Dumper::Useqq = 1;
|
||||
for my $param (sort keys %params) {
|
||||
my $val = $params{$param};
|
||||
# obscure passwords
|
||||
$val = "*****" if $param =~ /password/i;
|
||||
# limit line length
|
||||
$val =~ s/^(.{512}).*$/$1\[CHOP\]/;
|
||||
$mesg .= "[$$] " . Data::Dumper->Dump([$val],["param($param)"]);
|
||||
my $message;
|
||||
unless (Bugzilla->template->process("global/$type-error.html.tmpl", $vars, \$message))
|
||||
{
|
||||
# A template error occurred during reporting the error...
|
||||
$message = Bugzilla->template->error() . ' during reporting ' . uc($type) . ' error ' . $error;
|
||||
$vars = {
|
||||
nested_error => $vars,
|
||||
error => 'template_error',
|
||||
template_error_msg => $message,
|
||||
};
|
||||
if ($type ne 'code' || $error ne 'template_error')
|
||||
{
|
||||
_throw_error('code', 'template_error', $vars);
|
||||
}
|
||||
for my $var (sort keys %ENV) {
|
||||
my $val = $ENV{$var};
|
||||
$val = "*****" if $val =~ /password|http_pass/i;
|
||||
$mesg .= "[$$] " . Data::Dumper->Dump([$val],["env($var)"]);
|
||||
}
|
||||
open(ERRORLOGFID, ">>$datadir/errorlog");
|
||||
print ERRORLOGFID "$mesg\n";
|
||||
close ERRORLOGFID;
|
||||
# If we failed processing template error, simply die
|
||||
$mode = ERROR_MODE_DIE;
|
||||
}
|
||||
|
||||
my $template = Bugzilla->template;
|
||||
if (Bugzilla->error_mode == ERROR_MODE_WEBPAGE) {
|
||||
my $msg;
|
||||
|
||||
# Report error into [$datadir/] params.error_log if requested
|
||||
if (my $logfile = Bugzilla->params->{error_log})
|
||||
{
|
||||
$logfile = bz_locations()->{datadir} . '/' . $logfile if substr($logfile, 0, 1) ne '/';
|
||||
my $fd;
|
||||
# If we can write into error log, log error details there
|
||||
if (open $fd, ">>", $logfile)
|
||||
{
|
||||
print $fd (("-" x 75) . "\n" . ($msg ||= _error_message($type, $error, $vars)) . "\n");
|
||||
close $fd;
|
||||
}
|
||||
}
|
||||
|
||||
# Report error to maintainer email if requested
|
||||
if (Bugzilla->params->{"report_${type}_errors_to_maintainer"})
|
||||
{
|
||||
# Don't call _error_message twice
|
||||
$msg ||= _error_message($type, $error, $vars);
|
||||
my $t =
|
||||
"From: ".Bugzilla->params->{mailfrom}."\n".
|
||||
"To: ".Bugzilla->params->{maintainer}."\n".
|
||||
"Subject: ".uc($type)." error $error\n".
|
||||
"X-Bugzilla-Type: ${type}error\n\n".
|
||||
$msg;
|
||||
MessageToMTA($t, 1);
|
||||
}
|
||||
|
||||
if ($mode == ERROR_MODE_WEBPAGE) {
|
||||
print Bugzilla->cgi->header();
|
||||
$template->process($name, $vars)
|
||||
|| ThrowTemplateError($template->error());
|
||||
print $message;
|
||||
}
|
||||
else {
|
||||
my $message;
|
||||
$template->process($name, $vars, \$message)
|
||||
|| ThrowTemplateError($template->error());
|
||||
if (Bugzilla->error_mode == ERROR_MODE_DIE) {
|
||||
die("$message\n");
|
||||
elsif ($mode == ERROR_MODE_DIE) {
|
||||
die bless { message => ($msg ||= _error_message($type, $error, $vars)) };
|
||||
}
|
||||
elsif (Bugzilla->error_mode == ERROR_MODE_DIE_SOAP_FAULT) {
|
||||
elsif ($mode == ERROR_MODE_DIE_SOAP_FAULT) {
|
||||
# Clone the hash so we aren't modifying the constant.
|
||||
my %error_map = %{ WS_ERROR_CODE() };
|
||||
require Bugzilla::Hook;
|
||||
|
@ -110,12 +146,12 @@ sub _throw_error {
|
|||
{ error_map => \%error_map });
|
||||
my $code = $error_map{$error};
|
||||
if (!$code) {
|
||||
$code = ERROR_UNKNOWN_FATAL if $name =~ /code/i;
|
||||
$code = ERROR_UNKNOWN_TRANSIENT if $name =~ /user/i;
|
||||
$code = ERROR_UNKNOWN_FATAL if $type eq 'code';
|
||||
$code = ERROR_UNKNOWN_TRANSIENT if $type eq 'user';
|
||||
}
|
||||
die SOAP::Fault->faultcode($code)->faultstring($message);
|
||||
die bless { message => SOAP::Fault->faultcode($code)->faultstring($message) };
|
||||
}
|
||||
elsif (Bugzilla->error_mode == ERROR_MODE_AJAX) {
|
||||
elsif ($mode == ERROR_MODE_AJAX) {
|
||||
# JSON can't handle strings across lines.
|
||||
$message =~ s/\n/ /gm;
|
||||
my $err;
|
||||
|
@ -125,62 +161,23 @@ sub _throw_error {
|
|||
my $json = new JSON;
|
||||
print $json->encode($err);
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
sub ThrowUserError {
|
||||
_throw_error("global/user-error.html.tmpl", @_);
|
||||
sub ThrowUserError
|
||||
{
|
||||
_throw_error('user', @_);
|
||||
}
|
||||
|
||||
sub ThrowCodeError {
|
||||
_throw_error("global/code-error.html.tmpl", @_);
|
||||
sub ThrowCodeError
|
||||
{
|
||||
_throw_error('code', @_);
|
||||
}
|
||||
|
||||
sub ThrowTemplateError {
|
||||
sub ThrowTemplateError
|
||||
{
|
||||
my ($template_err) = @_;
|
||||
my $dbh = Bugzilla->dbh;
|
||||
|
||||
# Make sure the transaction is rolled back (if supported).
|
||||
$dbh->bz_rollback_transaction() if $dbh->bz_in_transaction();
|
||||
|
||||
my $vars = {};
|
||||
if (Bugzilla->error_mode == ERROR_MODE_DIE) {
|
||||
die("error: template error: $template_err");
|
||||
}
|
||||
|
||||
$vars->{'template_error_msg'} = $template_err;
|
||||
$vars->{'error'} = "template_error";
|
||||
|
||||
my $template = Bugzilla->template;
|
||||
|
||||
# Try a template first; but if this one fails too, fall back
|
||||
# on plain old print statements.
|
||||
if (!$template->process("global/code-error.html.tmpl", $vars)) {
|
||||
my $maintainer = Bugzilla->params->{'maintainer'};
|
||||
my $error = html_quote($vars->{'template_error_msg'});
|
||||
my $error2 = html_quote($template->error());
|
||||
print <<END;
|
||||
<tt>
|
||||
<p>
|
||||
Bugzilla has suffered an internal error. Please save this page and
|
||||
send it to $maintainer with details of what you were doing at the
|
||||
time this message appeared.
|
||||
</p>
|
||||
<script type="text/javascript"> <!--
|
||||
document.write("<p>URL: " +
|
||||
document.location.href.replace(/&/g,"&")
|
||||
.replace(/</g,"<")
|
||||
.replace(/>/g,">") + "</p>");
|
||||
// -->
|
||||
</script>
|
||||
<p>Template->process() failed twice.<br>
|
||||
First error: $error<br>
|
||||
Second error: $error2</p>
|
||||
</tt>
|
||||
END
|
||||
}
|
||||
exit;
|
||||
_throw_error('code', 'template_error', { template_error_msg => "$template_err" });
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -0,0 +1,87 @@
|
|||
[%# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# CustIS "nice error" template.
|
||||
#
|
||||
# Contributor(s): Vitaliy Filippov <vitalif@mail.ru>
|
||||
#%]
|
||||
|
||||
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
|
||||
[% USE Bugzilla %]
|
||||
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
|
||||
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
|
||||
[% error_message FILTER none %]
|
||||
[% ELSE %]
|
||||
[% error_message FILTER txt %]
|
||||
[% END %]
|
||||
[% RETURN %]
|
||||
[% END %]
|
||||
|
||||
[%# Template errors are special in the sense of possibility to
|
||||
# raise a second error when trying to process other templates.
|
||||
# So don't try to do it. %]
|
||||
[% IF error != "template_error" %]
|
||||
[% UNLESS header_done %]
|
||||
[% PROCESS global/header.html.tmpl %]
|
||||
[% END %]
|
||||
|
||||
[% PROCESS global/docslinks.html.tmpl
|
||||
docslinks = docslinks
|
||||
admindocslinks = admindocslinks
|
||||
%]
|
||||
[% END %]
|
||||
|
||||
<div style="margin: 20px; padding: 10px; font-size: 130%; float: left; font-family: sans-serif; border: 10px solid red">
|
||||
<img src="images/kitten.png" style="float: left; margin-right: 10px" />
|
||||
<p style="margin: 0">
|
||||
Произошла внутренняя ошибка. Извините... Кто-то, похоже, погрыз провода.<br>
|
||||
</p>
|
||||
<div style="font-size: 150%; background-color: #ffd0d0">
|
||||
<p style="margin: 0.5em 0 0 0">[% error_message.replace("\n\n", "</p><p>") FILTER none %]</p>
|
||||
</div>
|
||||
<p style="margin-bottom: 0px">
|
||||
[% IF Param('report_code_errors_to_maintainer') %]
|
||||
Ошибка автоматически отправлена <tt><a href="mailto:[% Param('maintainer') %]">[% Param('maintainer') %]</a></tt>.<br>
|
||||
Так что он о ней, вероятно, знает, и скоро всё будет хорошо. А потом просто нажмите F5.<br>
|
||||
Не пользуйтесь лифтами во время пожара!
|
||||
[% ELSE %]
|
||||
Пожалуйста, сохраните эту страницу и отправьте её по адресу <tt><a href="mailto:[% Param('maintainer') %]">[% Param('maintainer') %]</a></tt>
|
||||
с информацией о том, какие Ваши действия привели к ошибке и некоторым количеством укора.
|
||||
<tt>
|
||||
<script type="text/javascript"> <!--
|
||||
document.write("<p>URL: " +
|
||||
document.location.href.replace(/&/g,"&")
|
||||
.replace(/</g,"<")
|
||||
.replace(/>/g,">") + "</p>");
|
||||
// -->
|
||||
</script>
|
||||
</tt>
|
||||
[% END %]
|
||||
</p>
|
||||
<p style="margin-bottom: 0px">Ещё раз извините.</p>
|
||||
[% IF Param('report_code_errors_to_maintainer') %]
|
||||
<div style="float: right; margin-left: 10px; color: #404040; text-align: center; font-size: 90%">
|
||||
<img src="images/pzil.jpg" alt="Администраторы уже выехали!" /><br>
|
||||
Администраторы уже выехали!
|
||||
</div>
|
||||
[% END %]
|
||||
[% IF variables %]
|
||||
<pre>
|
||||
Дополнительные данные:
|
||||
[% FOREACH key = variables.keys %]
|
||||
[%+ key FILTER html %]: [%+ variables.$key FILTER html %]
|
||||
[% END %]
|
||||
</pre>
|
||||
[% END %]
|
||||
</div>
|
||||
|
||||
[% IF error != "template_error" %]
|
||||
[% PROCESS global/footer.html.tmpl %]
|
||||
[% END %]
|
|
@ -106,5 +106,13 @@
|
|||
"If you are running a release candidate, you will get " _
|
||||
"a notification for newer release candidates too.</li>" _
|
||||
"<li>'disabled' will never notify you about new releases and no " _
|
||||
"connection will be established to a remote server.</li></ul>" }
|
||||
"connection will be established to a remote server.</li></ul>",
|
||||
|
||||
error_log => "Path to Bugzilla error log or empty string if you don't want to write an error log. " _
|
||||
"Relative paths will be prepended with Bugzilla data directory.",
|
||||
|
||||
report_code_errors_to_maintainer => "Whether to send e-mail messages about each 'code' (internal) error to Bugzilla maintainer.",
|
||||
report_user_errors_to_maintainer => "Whether to send e-mail messages about each 'user' (non-fatal) error to Bugzilla maintainer.",
|
||||
|
||||
}
|
||||
%]
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
[%# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
||||
# Vitaliy Filippov <vitalif@mail.ru>
|
||||
#%]
|
||||
|
||||
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
|
||||
[% USE Bugzilla %]
|
||||
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
|
||||
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
|
||||
[% error_message FILTER none %]
|
||||
[% ELSE %]
|
||||
[% error_message FILTER txt %]
|
||||
[% END %]
|
||||
[% RETURN %]
|
||||
[% END %]
|
||||
|
||||
[%# Template errors are special in the sense of possibility to
|
||||
# raise a second error when trying to process other templates.
|
||||
# So don't try to do it. %]
|
||||
[% IF error != "template_error" %]
|
||||
[% UNLESS header_done %]
|
||||
[% PROCESS global/header.html.tmpl %]
|
||||
[% END %]
|
||||
|
||||
[% PROCESS global/docslinks.html.tmpl
|
||||
docslinks = docslinks
|
||||
admindocslinks = admindocslinks
|
||||
%]
|
||||
[% END %]
|
||||
|
||||
<div style="padding: 20px; background-color: #ff8080; font-size: 130%">
|
||||
<p style="margin: 0">
|
||||
Sorry! [% terms.Bugzilla %] has suffered an internal error.<br>
|
||||
[% IF Param('report_code_errors_to_maintainer') %]
|
||||
Error was reported automatically to instance maintainer <tt><a href="mailto:[% Param('maintainer') %]">[% Param('maintainer') %]</a></tt>.
|
||||
So he probably knows about it and is already on charge.
|
||||
[% ELSE %]
|
||||
Please save this page and send it to <tt><a href="mailto:[% Param('maintainer') %]">[% Param('maintainer') %]</a></tt> with details
|
||||
of what you were doing at the time this message appeared.
|
||||
[% END %]
|
||||
</p>
|
||||
<p style="font-size: 150%; margin: 0.5em 0 0 0">[% error_message.replace("\n\n", "</p><p>") FILTER none %]</p>
|
||||
<p style="margin-bottom: 0px">We apologize for your inconvenience.</p>
|
||||
</div>
|
||||
|
||||
<tt>
|
||||
<script type="text/javascript"> <!--
|
||||
document.write("<p>URL: " +
|
||||
document.location.href.replace(/&/g,"&")
|
||||
.replace(/</g,"<")
|
||||
.replace(/>/g,">") + "</p>");
|
||||
// -->
|
||||
</script>
|
||||
</tt>
|
||||
|
||||
[% IF variables %]
|
||||
<pre>
|
||||
Variables:
|
||||
[% FOREACH key = variables.keys %]
|
||||
[%+ key FILTER html %]: [%+ variables.$key FILTER html %]
|
||||
[% END %]
|
||||
</pre>
|
||||
[% END %]
|
||||
|
||||
[% IF error != "template_error" %]
|
||||
[% PROCESS global/footer.html.tmpl %]
|
||||
[% END %]
|
|
@ -16,6 +16,7 @@
|
|||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
||||
# Vitaliy Filippov <vitalif@mail.ru>
|
||||
#%]
|
||||
|
||||
[%# INTERFACE:
|
||||
|
@ -32,10 +33,10 @@
|
|||
# in this file; if you do not wish to change it, use the "none" filter.
|
||||
#%]
|
||||
|
||||
[% PROCESS "global/field-descs.none.tmpl" %]
|
||||
|
||||
[% DEFAULT title = "Internal Error" %]
|
||||
|
||||
[% PROCESS "global/variables.none.tmpl" %]
|
||||
|
||||
[% error_message = BLOCK %]
|
||||
[% IF error == "action_unrecognized" %]
|
||||
[% docslinks = {'query.html' => "Searching for $terms.bugs",
|
||||
|
@ -335,6 +336,7 @@
|
|||
moving the [% terms.bug %].
|
||||
|
||||
[% ELSIF error == "no_open_bug_status" %]
|
||||
[% PROCESS "global/field-descs.none.tmpl" %]
|
||||
[% title = "$terms.Bug Cannot Be Confirmed" %]
|
||||
There is no valid transition from
|
||||
[%+ get_status("UNCONFIRMED") FILTER html %] to an open state.
|
||||
|
@ -476,74 +478,20 @@
|
|||
[% ELSIF error == "invalid_remind_me_about_flags" %]
|
||||
Invalid setting for remind_me_about_flags
|
||||
|
||||
[% ELSIF error == "eval_error" %]
|
||||
Generic code error: [% eval_error.replace("\n","<br>") %]
|
||||
|
||||
[% ELSE %]
|
||||
[%# Try to find hooked error messages %]
|
||||
[% error_message = Hook.process("errors") %]
|
||||
[% IF NOT error_message %]
|
||||
[% title = "Internal error" %]
|
||||
An internal error has occurred, but [% terms.Bugzilla %] doesn't know
|
||||
what <code>[% error FILTER html %]</code> means.
|
||||
|
||||
If you are a [% terms.Bugzilla %] end-user seeing this message, please save
|
||||
this page and send it to [% Param('maintainer') %].
|
||||
what <b><tt>[% error FILTER html %]</tt></b> means.
|
||||
[% ELSE %]
|
||||
[% error_message FILTER none %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
|
||||
[% USE Bugzilla %]
|
||||
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
|
||||
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
|
||||
[% error_message FILTER none %]
|
||||
[% ELSE %]
|
||||
[% error_message FILTER txt %]
|
||||
[% END %]
|
||||
[% RETURN %]
|
||||
[% END %]
|
||||
|
||||
[% UNLESS header_done %]
|
||||
[% PROCESS global/header.html.tmpl %]
|
||||
[% END %]
|
||||
|
||||
[% PROCESS global/docslinks.html.tmpl
|
||||
docslinks = docslinks
|
||||
admindocslinks = admindocslinks
|
||||
%]
|
||||
|
||||
<tt>
|
||||
<p>
|
||||
[% terms.Bugzilla %] has suffered an internal error. Please save this page and send
|
||||
it to [% Param("maintainer") %] with details of what you were doing at
|
||||
the time this message appeared.
|
||||
</p>
|
||||
<script type="text/javascript"> <!--
|
||||
document.write("<p>URL: " +
|
||||
document.location.href.replace(/&/g,"&")
|
||||
.replace(/</g,"<")
|
||||
.replace(/>/g,">") + "</p>");
|
||||
// -->
|
||||
</script>
|
||||
</tt>
|
||||
|
||||
<table cellpadding="20">
|
||||
<tr>
|
||||
<td bgcolor="#ff0000">
|
||||
<font size="+2">
|
||||
[% error_message FILTER none %]
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
[% IF variables %]
|
||||
<pre>
|
||||
Variables:
|
||||
[% FOREACH key = variables.keys %]
|
||||
[%+ key FILTER html %]: [%+ variables.$key FILTER html %]
|
||||
[% END %]
|
||||
</pre>
|
||||
[% END %]
|
||||
|
||||
[% PROCESS global/footer.html.tmpl %]
|
||||
[% PROCESS "global/code-error-page.html.tmpl" %]
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#
|
||||
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
||||
# Svetlana Harisova <light@rathedg.com>
|
||||
# Vitaliy Filippov <vitalif@mail.ru>
|
||||
#%]
|
||||
|
||||
[% DEFAULT qs_suffix = "" %]
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
||||
# Svetlana Harisova <light@rathedg.com>
|
||||
# Marc Schumann <wurblzap@gmail.com>
|
||||
# Vitaliy Filippov <vitalif@mail.ru>
|
||||
#%]
|
||||
|
||||
[%# Migration note: this whole file corresponds to the old %commandmenu%
|
||||
|
|
Loading…
Reference in New Issue