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
7ab84415
Commit
7ab84415
authored
Nov 08, 2004
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 257344: Remove exit from error handlers when non-interactive
r=glob,justdave a=justdave
parent
1f389b91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
Bugzilla.pm
Bugzilla.pm
+17
-0
Error.pm
Bugzilla/Error.pm
+13
-5
No files found.
Bugzilla.pm
View file @
7ab84415
...
...
@@ -111,6 +111,16 @@ sub dbh {
return
$_dbh
;
}
my
$_batch
;
sub
batch
{
my
$class
=
shift
;
my
$newval
=
shift
;
if
(
$newval
)
{
$_batch
=
$newval
;
}
return
$_batch
||
0
;
}
sub
dbwritesallowed
{
my
$class
=
shift
;
...
...
@@ -282,6 +292,13 @@ Essentially, causes calls to C<Bugzilla->user> to return C<undef>. This has the
effect of logging out a user for the current request only; cookies and
database sessions are left intact.
=item C<batch>
Set to true, by calling Bugzilla->batch(1), to indicate that Bugzilla is
being called in a non-interactive manner and errors should be passed to
die() rather than being sent to a browser and finished with an exit().
Bugzilla->batch will return the current state of this flag.
=item C<dbh>
The current database handle. See L<DBI>.
...
...
Bugzilla/Error.pm
View file @
7ab84415
...
...
@@ -69,12 +69,17 @@ sub _throw_error {
close
ERRORLOGFID
;
}
print
Bugzilla
->
cgi
->
header
();
my
$template
=
Bugzilla
->
template
;
$template
->
process
(
$name
,
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
if
(
Bugzilla
->
batch
)
{
my
$message
;
$template
->
process
(
$name
,
$vars
,
\
$message
)
||
ThrowTemplateError
(
$template
->
error
());
die
(
"$message"
);
}
else
{
print
Bugzilla
->
cgi
->
header
();
$template
->
process
(
$name
,
$vars
)
||
ThrowTemplateError
(
$template
->
error
());
}
exit
;
}
...
...
@@ -90,6 +95,9 @@ sub ThrowTemplateError {
my
(
$template_err
)
=
@_
;
my
$vars
=
{};
if
(
Bugzilla
->
batch
)
{
die
(
"error: template error: $template_err"
);
}
$vars
->
{
'template_error_msg'
}
=
$template_err
;
$vars
->
{
'error'
}
=
"template_error"
;
...
...
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