diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-06-25 22:17:52 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-06-28 22:42:02 +0200 |
commit | b2693c9f5ce34c864a4323abf4c89836c263a7ea (patch) | |
tree | 0262ab8a7335410c54390c820b62828153586eac /Bugzilla/Error.pm | |
parent | 06d601b703e3f510dcc7f705600f0feb8ddb71b8 (diff) | |
download | bugzilla-b2693c9f5ce34c864a4323abf4c89836c263a7ea.tar.gz bugzilla-b2693c9f5ce34c864a4323abf4c89836c263a7ea.tar.xz |
remove weird hacks
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r-- | Bugzilla/Error.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index ad195f02f..9fcd16386 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -124,11 +124,12 @@ sub _throw_error { message => $message, id => $server->{_bz_request_id}, version => $server->version); - # if _bz_will_handle_error is set, we're inside the _handle() function - # and we don't need to call $server->response. - unless ($server->{_bz_will_handle_error}) { - $server->response($server->error_response_header); - } + # 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 if _in_eval(); + $server->response($server->error_response_header); } } |