summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Server.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/Bugzilla/WebService/Server.pm b/Bugzilla/WebService/Server.pm
index a76c4c48c..e02788911 100644
--- a/Bugzilla/WebService/Server.pm
+++ b/Bugzilla/WebService/Server.pm
@@ -11,12 +11,15 @@ use 5.10.1;
use strict;
use warnings;
+use Bugzilla::Logging;
use Bugzilla::Error;
use Bugzilla::Util qw(datetime_from);
use Digest::MD5 qw(md5_base64);
use Scalar::Util qw(blessed);
use Storable qw(freeze);
+use Module::Runtime qw(require_module);
+use Try::Tiny;
sub handle_login {
my ($self, $class, $method, $full_method) = @_;
@@ -30,8 +33,13 @@ sub handle_login {
Bugzilla->request_cache->{dont_persist_session} = 1;
}
- eval "require $class";
- ThrowCodeError('unknown_method', {method => $full_method}) if $@;
+ try {
+ require_module($class);
+ }
+ catch {
+ ThrowCodeError('unknown_method', {method => $full_method});
+ FATAL($_);
+ };
return if ($class->login_exempt($method)
and !defined Bugzilla->input_params->{Bugzilla_login});
Bugzilla->login();