From 41beb175fdeffa2ac3598a714ac3acb985ba86a4 Mon Sep 17 00:00:00 2001 From: Koosha Khajeh Moogahi Date: Tue, 24 Apr 2012 23:21:22 +0200 Subject: Bug 645433: Bugzilla->error_mode( ERROR_MODE_WEBPAGE ) doesn't change Bugzilla->error_mode r/a=LpSolit --- Bugzilla.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 621222e8a..ccd384067 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -445,8 +445,14 @@ sub error_mode { if (defined $newval) { $class->request_cache->{error_mode} = $newval; } - return $class->request_cache->{error_mode} - || (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE); + + # XXX - Once we require Perl 5.10.1, this test can be replaced by //. + if (exists $class->request_cache->{error_mode}) { + return $class->request_cache->{error_mode}; + } + else { + return (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE); + } } # This is used only by Bugzilla::Error to throw errors. -- cgit v1.2.3-24-g4f1b