Use ThrowCodeError on die() while in console

hinted-selects
Vitaliy Filippov 2014-10-29 20:28:07 +03:00
parent 70b8dbe1b7
commit cff0f1ba93
1 changed files with 5 additions and 7 deletions

View File

@ -61,15 +61,13 @@ BEGIN
sub _die_error
{
# We are either in application heat-up phase or in some eval()
if (!$ENV{GATEWAY_INTERFACE} || Bugzilla::Error::_in_eval())
{
die @_;
}
if (ref $_[0] eq 'Bugzilla::Error' || ref $_[0] eq 'Bugzilla::HTTPServerSimple::FakeExit')
# We are in some eval(), or we are passed the exception object
if (Bugzilla::Error::_in_eval() ||
ref $_[0] eq 'Bugzilla::Error' ||
ref $_[0] eq 'Bugzilla::HTTPServerSimple::FakeExit')
{
# Bugzilla::Error has overloaded conversion to string
# Bugzilla::HTTPServerSimple::FakeExit should only terminate the request
# Bugzilla::HTTPServerSimple::FakeExit only terminates the request
die @_;
}
else