summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Error.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-11-21 08:37:26 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-11-21 08:37:26 +0100
commita4528b84c02ebb1d7b9bff1f068283e28c5186de (patch)
treeb37028daa37a9befa3eb97e5feed945476a56c3b /Bugzilla/Error.pm
parentedaf6506a009280be2e3b894b5563609b9ff734d (diff)
downloadbugzilla-a4528b84c02ebb1d7b9bff1f068283e28c5186de.tar.gz
bugzilla-a4528b84c02ebb1d7b9bff1f068283e28c5186de.tar.xz
Bug 703928: Bugzilla::Util should depend on Bugzilla::Error, not the opposite
r=dkl a=LpSolit
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r--Bugzilla/Error.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 395cc0dc9..b88e9a265 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -30,7 +30,7 @@ use base qw(Exporter);
use Bugzilla::Constants;
use Bugzilla::WebService::Constants;
-use Bugzilla::Util;
+use Bugzilla::Hook;
use Carp;
use Data::Dumper;
@@ -62,12 +62,13 @@ sub _throw_error {
my $datadir = bz_locations()->{'datadir'};
# If a writable $datadir/errorlog exists, log error details there.
if (-w "$datadir/errorlog") {
+ require Bugzilla::Util;
require Data::Dumper;
my $mesg = "";
for (1..75) { $mesg .= "-"; };
$mesg .= "\n[$$] " . time2str("%D %H:%M:%S ", time());
$mesg .= "$name $error ";
- $mesg .= remote_ip();
+ $mesg .= Bugzilla::Util::remote_ip();
$mesg .= Bugzilla->user->login;
$mesg .= (' actually ' . Bugzilla->sudoer->login) if Bugzilla->sudoer;
$mesg .= "\n";
@@ -115,7 +116,6 @@ sub _throw_error {
{
# 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};
@@ -186,6 +186,8 @@ sub ThrowTemplateError {
# 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)) {
+ require Bugzilla::Util;
+ import Bugzilla::Util qw(html_quote);
my $maintainer = Bugzilla->params->{'maintainer'};
my $error = html_quote($vars->{'template_error_msg'});
my $error2 = html_quote($template->error());