summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorJeff Fearn <Jeff.Fearn@gmail.com>2014-12-17 06:09:01 +0100
committerByron Jones <glob@mozilla.com>2014-12-17 06:09:01 +0100
commitbd4dcb0484989284ea76efe567dd612a32de1ddf (patch)
tree664dbeb89e941d32f3ea5ef3a815fb316f4b8ec0 /Bugzilla/DB.pm
parentf1d4771b6317236748abaaa035b2635f3baa3635 (diff)
downloadbugzilla-bd4dcb0484989284ea76efe567dd612a32de1ddf.tar.gz
bugzilla-bd4dcb0484989284ea76efe567dd612a32de1ddf.tar.xz
Bug 1089475: Use "ThrowCodeError" when a database error occurs instead of dumping a stack trace
r=glob,a=glob
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 9f3ed0f49..afe728ca7 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -142,6 +142,11 @@ sub _handle_error {
$_[0] = substr($_[0], 0, 2000) . ' ... ' . substr($_[0], -2000)
if length($_[0]) > 4000;
$_[0] = Carp::longmess($_[0]);
+
+ if (Bugzilla->usage_mode == USAGE_MODE_BROWSER) {
+ ThrowCodeError("db_error", { err_message => $_[0] });
+ }
+
return 0; # Now let DBI handle raising the error
}