From b2693c9f5ce34c864a4323abf4c89836c263a7ea Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 25 Jun 2018 16:17:52 -0400 Subject: remove weird hacks --- Bugzilla/Error.pm | 11 ++++++----- Bugzilla/WebService/Server/JSONRPC.pm | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Bugzilla') 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); } } diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 38c8da296..093167048 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -271,7 +271,6 @@ sub _handle { my $self = shift; my ($obj) = @_; $self->{_bz_request_id} = $obj->{id}; - local $self->{_bz_will_handle_error} = 1; my $result = $self->SUPER::_handle(@_); -- cgit v1.2.3-24-g4f1b