From 871de5e2dbb48867b08371ce90881d8f85b18ff1 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 20 Jan 2016 21:53:45 +0000 Subject: Bug 1240029 - The REST API doesn't work correctly with mod_perl r=dylan --- Bugzilla/WebService/Server/JSONRPC.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Bugzilla/WebService/Server') diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 3fa0b65a9..a75bba836 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -273,6 +273,9 @@ sub _handle { my $result = $self->SUPER::_handle(@_); + # Reset in_eval to so we get normal exceptions from here + Bugzilla->request_cache->{in_eval} = 0; + # Set the ETag if not already set in the webservice methods. my $etag = $self->bz_etag; if (!$etag && ref $result) { @@ -425,6 +428,9 @@ sub _argument_type_check { $params = [$params]; } + # Let Bugzilla::Error know we are inside an eval() after this point + Bugzilla->request_cache->{in_eval} = 1; + return $params; } -- cgit v1.2.3-24-g4f1b