summaryrefslogtreecommitdiffstats
path: root/Bugzilla/API
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-01-20 22:53:45 +0100
committerDavid Lawrence <dkl@mozilla.com>2016-01-20 22:53:45 +0100
commit871de5e2dbb48867b08371ce90881d8f85b18ff1 (patch)
tree2b64ab069624a7c9a24ad6b92e71c360a4905d88 /Bugzilla/API
parent864d9b8f7988fa8e1f069c96956573fc67ebccfa (diff)
downloadbugzilla-871de5e2dbb48867b08371ce90881d8f85b18ff1.tar.gz
bugzilla-871de5e2dbb48867b08371ce90881d8f85b18ff1.tar.xz
Bug 1240029 - The REST API doesn't work correctly with mod_perl
r=dylan
Diffstat (limited to 'Bugzilla/API')
-rw-r--r--Bugzilla/API/1_0/Server.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/Bugzilla/API/1_0/Server.pm b/Bugzilla/API/1_0/Server.pm
index 743af59a1..627da1e58 100644
--- a/Bugzilla/API/1_0/Server.pm
+++ b/Bugzilla/API/1_0/Server.pm
@@ -211,12 +211,18 @@ sub _handle {
my $method = $self->method_name;
my $controller = $self->controller;
my $params = Bugzilla->input_params;
+ my $cache = Bugzilla->request_cache;
unless ($controller->can($method)) {
return $self->return_error(302, "No such a method : '$method'.");
}
- my $result = eval q| $controller->$method($params) |;
+ # Let Bugzilla::Error know we are inside an eval() for exceptions
+ $cache->{in_eval} = 1;
+ my $result = eval { $controller->$method($params) };
+ $cache->{in_eval} = 0;
+
+ return $self->return_error if $self->return_error;
if ($@) {
return $self->return_error(500, "Procedure error: $@");