Bug 58633

Rework Bugzilla internal error handling


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@605 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2009-12-25 13:43:40 +00:00
parent c59d7c7cbc
commit 4a02af6c8b
11 changed files with 373 additions and 216 deletions

View File

@ -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 = {};

View File

@ -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',

View File

@ -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,142 +49,135 @@ 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 (Bugzilla->error_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;
Bugzilla::Hook::process('webservice-error_codes',
{ 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;
}
die SOAP::Fault->faultcode($code)->faultstring($message);
}
elsif (Bugzilla->error_mode == ERROR_MODE_AJAX) {
# JSON can't handle strings across lines.
$message =~ s/\n/ /gm;
my $err;
$err->{'success'} = JSON::false;
$err->{'error'} = $error;
$err->{'message'} = $message;
my $json = new JSON;
print $json->encode($err);
elsif ($mode == ERROR_MODE_DIE) {
die bless { message => ($msg ||= _error_message($type, $error, $vars)) };
}
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;
Bugzilla::Hook::process('webservice-error_codes',
{ error_map => \%error_map });
my $code = $error_map{$error};
if (!$code) {
$code = ERROR_UNKNOWN_FATAL if $type eq 'code';
$code = ERROR_UNKNOWN_TRANSIENT if $type eq 'user';
}
die bless { message => SOAP::Fault->faultcode($code)->faultstring($message) };
}
elsif ($mode == ERROR_MODE_AJAX) {
# JSON can't handle strings across lines.
$message =~ s/\n/ /gm;
my $err;
$err->{'success'} = JSON::false;
$err->{'error'} = $error;
$err->{'message'} = $message;
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,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;") + "</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;

BIN
images/kitten.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
images/pzil.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -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,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;") + "</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 %]

View File

@ -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.",
}
%]

View File

@ -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,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;") + "</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 %]

View File

@ -16,6 +16,7 @@
# Rights Reserved.
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Vitaliy Filippov <vitalif@mail.ru>
#%]
[%# INTERFACE:
@ -32,19 +33,19 @@
# 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",
'query.html#list' => "$terms.Bug lists"} %]
I don't recognize the value (<em>[% action FILTER html %]</em>)
of the <em>action</em> variable.
[% ELSIF error == "attachment_already_obsolete" %]
Attachment #[% attach_id FILTER html %] ([% description FILTER html %])
Attachment #[% attach_id FILTER html %] ([% description FILTER html %])
is already obsolete.
[% ELSIF error == "auth_invalid_email" %]
@ -75,9 +76,9 @@
<code>[% function FILTER html %]</code> function.
[% ELSIF error == "bug_error" %]
Trying to retrieve [% terms.bug %] [%+ bug.bug_id FILTER html %] returned
Trying to retrieve [% terms.bug %] [%+ bug.bug_id FILTER html %] returned
the error [% bug.error FILTER html %].
[% ELSIF error == "chart_data_not_generated" %]
[% admindocslinks = {'extraconfig.html' => 'Setting up Charting'} %]
[% IF product %]
@ -94,14 +95,14 @@
[% ELSIF error == "chart_datafile_corrupt" %]
The chart data file [% file FILTER html %] is corrupt.
[% ELSIF error == "chart_dir_nonexistent" %]
One of the directories <tt>[% dir FILTER html %]</tt> and
One of the directories <tt>[% dir FILTER html %]</tt> and
<tt>[% graph_dir FILTER html %]</tt> does not exist.
[% ELSIF error == "chart_file_open_fail" %]
Unable to open the chart datafile <tt>[% filename FILTER html %]</tt>.
[% ELSIF error == "chart_lines_not_installed" %]
[% admindocslinks = {'installation.html#install-perlmodules' => 'Installing Perl modules necessary for Charting'} %]
Charts will not work without the Chart::Lines Perl module being installed.
@ -113,7 +114,7 @@
unless you specify something for the <code>$init_value</code> argument.
[% ELSIF error == "column_not_null_no_default_alter" %]
You cannot alter the [% name FILTER html %] column to be NOT NULL
You cannot alter the [% name FILTER html %] column to be NOT NULL
without specifying a default or something for $set_nulls_to, because
there are NULL values currently in it.
@ -125,7 +126,7 @@
Every cookie must have a value.
[% ELSIF error == "env_no_email" %]
[% terms.Bugzilla %] did not receive an email address from the
[% terms.Bugzilla %] did not receive an email address from the
environment.
[% IF Param("auth_env_email") %]
This means that the '[% Param("auth_env_email") FILTER html %]'
@ -181,13 +182,13 @@
[% ELSIF error == "invalid_attach_id_to_obsolete" %]
The attachment number of one of the attachments you wanted to obsolete,
[% attach_id FILTER html %], is invalid.
[% ELSIF error == "invalid_column_name_cookie" %]
[% title = "Invalid Column Name" %]
The custom sort order specified in your cookie contains an invalid
column name <em>[% fragment FILTER html %]</em>.
column name <em>[% fragment FILTER html %]</em>.
The cookie has been cleared.
[% ELSIF error == "invalid_column_name_form" %]
[% title = "Invalid Column Name" %]
The custom sort order specified in your form submission contains an
@ -220,9 +221,9 @@
setting in [% constants.bz_locations.localconfig FILTER html %].
[% ELSIF error == "mismatched_bug_ids_on_obsolete" %]
Attachment [% attach_id FILTER html %] ([% description FILTER html %])
is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %],
but you tried to flag it as obsolete while creating a new attachment to
Attachment [% attach_id FILTER html %] ([% description FILTER html %])
is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %],
but you tried to flag it as obsolete while creating a new attachment to
[% terms.bug %] [%+ my_bug_id FILTER html %].
[% ELSIF error == "flags_not_available" %]
@ -233,13 +234,13 @@
[% ELSE %]
References to existing flags when creating
a new attachment are invalid.
[% END %]
[% END %]
[% ELSIF error == "flag_requestee_disabled" %]
[% title = "Flag not Requestable from Specific Person" %]
You can't ask a specific person for
<em>[% type.name FILTER html %]</em>.
[% ELSIF error == "flag_status_invalid" %]
The flag status <em>[% status FILTER html %]</em>
[% IF id %]
@ -258,7 +259,7 @@
[% ELSIF error == "flag_type_target_type_invalid" %]
The target type was neither <em>[% terms.bug %]</em> nor <em>attachment</em>
but rather <em>[% target_type FILTER html %]</em>.
[% ELSIF error == "invalid_field_name" %]
Can't use [% field FILTER html %] as a field name.
@ -279,7 +280,7 @@
[% ELSIF error == "jobqueue_insert_failed" %]
[% title = "Job Queue Failure" %]
Inserting a <code>[% job FILTER html %]</code> job into the Job
Inserting a <code>[% job FILTER html %]</code> job into the Job
Queue failed with the following error: [% errmsg FILTER html %]
[% ELSIF error == "jobqueue_not_configured" %]
@ -293,7 +294,7 @@
to the <code>JOB_MAP</code> constant in <code>Bugzilla::JobQueue</code>.
[% ELSIF error == "ldap_bind_failed" %]
Failed to bind to the LDAP server. The error message was:
Failed to bind to the LDAP server. The error message was:
<code>[% errstr FILTER html %]</code>
[% ELSIF error == "ldap_cannot_retreive_attr" %]
@ -306,8 +307,8 @@
Could not start TLS with LDAP server: <code>[% error FILTER html %]</code>.
[% ELSIF error == "ldap_search_error" %]
An error occurred while trying to search LDAP for
&quot;[% username FILTER html %]&quot;:
An error occurred while trying to search LDAP for
&quot;[% username FILTER html %]&quot;:
<code>[% errstr FILTER html %]</code>
[% ELSIF error == "ldap_server_not_defined" %]
@ -320,13 +321,13 @@
[% ELSIF error == "missing_bug_id" %]
No [% terms.bug %] ID was given.
[% ELSIF error == "missing_series_id" %]
Having inserted a series into the database, no series_id was returned for
it. Series: [% series.category FILTER html %] /
[%+ series.subcategory FILTER html %] /
it. Series: [% series.category FILTER html %] /
[%+ series.subcategory FILTER html %] /
[%+ series.name FILTER html %].
[% ELSIF error == "need_quipid" %]
A valid quipid is needed.
@ -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.
@ -379,7 +381,7 @@
[% END %]
from
[% IF caller %]
<code>[%+ caller FILTER html %]</code>, which is
[% END %]
@ -398,14 +400,14 @@
The group field <em>[% group FILTER html %]</em> is invalid.
[% ELSIF error == "report_axis_invalid" %]
<em>[% val FILTER html %]</em> is not a valid value for
<em>[% val FILTER html %]</em> is not a valid value for
[%+ IF fld == "x" %]the horizontal axis
[%+ ELSIF fld == "y" %]the vertical axis
[%+ ELSIF fld == "z" %]the multiple tables/images
[%+ ELSE %]a report axis[% END %] field.
[% ELSIF error == "setting_info_invalid" %]
To create a new setting, you must supply a setting name, a list of
To create a new setting, you must supply a setting name, a list of
value/sortindex pairs, and the devault value.
[% ELSIF error == "setting_name_invalid" %]
@ -441,7 +443,7 @@
[% ELSIF error == "undefined_field" %]
Form field [% field FILTER html %] was not defined.
[% ELSIF error == "unknown_action" %]
[% IF action %]
Unknown action [% action FILTER html %]!
@ -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,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;") + "</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" %]

View File

@ -17,6 +17,7 @@
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Svetlana Harisova <light@rathedg.com>
# Vitaliy Filippov <vitalif@mail.ru>
#%]
[% DEFAULT qs_suffix = "" %]

View File

@ -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%