Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
bd4dcb04
Commit
bd4dcb04
authored
Dec 17, 2014
by
Jeff Fearn
Committed by
Byron Jones
Dec 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1089475: Use "ThrowCodeError" when a database error occurs instead of dumping a stack trace
r=glob,a=glob
parent
f1d4771b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
DB.pm
Bugzilla/DB.pm
+5
-0
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+4
-0
No files found.
Bugzilla/DB.pm
View file @
bd4dcb04
...
@@ -142,6 +142,11 @@ sub _handle_error {
...
@@ -142,6 +142,11 @@ sub _handle_error {
$_
[
0
]
=
substr
(
$_
[
0
],
0
,
2000
)
.
' ... '
.
substr
(
$_
[
0
],
-
2000
)
$_
[
0
]
=
substr
(
$_
[
0
],
0
,
2000
)
.
' ... '
.
substr
(
$_
[
0
],
-
2000
)
if
length
(
$_
[
0
])
>
4000
;
if
length
(
$_
[
0
])
>
4000
;
$_
[
0
]
=
Carp::
longmess
(
$_
[
0
]);
$_
[
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
return
0
;
# Now let DBI handle raising the error
}
}
...
...
template/en/default/global/code-error.html.tmpl
View file @
bd4dcb04
...
@@ -104,6 +104,10 @@
...
@@ -104,6 +104,10 @@
[% ELSIF error == "comment_type_invalid" %]
[% ELSIF error == "comment_type_invalid" %]
'[% type FILTER html %]' is not a valid comment type.
'[% type FILTER html %]' is not a valid comment type.
[% ELSIF error == "db_error" %]
An error occurred while performing a database operation:
<pre>[% err_message FILTER html %]</pre>
[% ELSIF error == "db_rename_conflict" %]
[% ELSIF error == "db_rename_conflict" %]
Name conflict: Cannot rename [% old FILTER html %] to
Name conflict: Cannot rename [% old FILTER html %] to
[%+ new FILTER html %] because [% new FILTER html %] already exists.
[%+ new FILTER html %] because [% new FILTER html %] already exists.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment