diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-01 03:05:14 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-01 03:05:14 +0200 |
commit | 11e17befd5f484859eea97b5bf831d220ce2b2a8 (patch) | |
tree | 3ebf5a3ceab5a8022c898da67757c838fc057736 /Bugzilla | |
parent | c2369536b50954f8ede0f5e356521d4f58d4efde (diff) | |
download | bugzilla-11e17befd5f484859eea97b5bf831d220ce2b2a8.tar.gz bugzilla-11e17befd5f484859eea97b5bf831d220ce2b2a8.tar.xz |
Bug 554714: Make JSON-RPC throw errors properly even if they are thrown
before method evaluation (like during checking of Bugzilla_login and
Bugzilla_password)
r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Error.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 98e7d1d2f..0c471125d 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -127,9 +127,12 @@ sub _throw_error { message => $message, id => $server->{_bz_request_id}, version => $server->version); - # We die with no message. JSON::RPC checks raise_error before + # Most JSON-RPC Throw*Error calls happen within an eval inside + # of JSON::RPC. So, in that circumstance, instead of exiting, + # we die with no message. JSON::RPC checks raise_error before # it checks $@, so it returns the proper error. - die; + die if _in_eval(); + $server->response($server->error_response_header); } } } |