summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla.pm10
1 files changed, 8 insertions, 2 deletions
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.