useragent: Raise an exception if the LWP module can't be loaded

Signed-off-by: Simon McVittie <smcv@debian.org>
master
Simon McVittie 2019-02-10 16:29:19 +00:00
parent 824cf7db1b
commit e7b0d4a0ff
1 changed files with 3 additions and 0 deletions

View File

@ -2470,6 +2470,9 @@ sub add_autofile ($$$) {
} }
sub useragent () { sub useragent () {
eval q{use LWP};
error($@) if $@;
return LWP::UserAgent->new( return LWP::UserAgent->new(
cookie_jar => $config{cookiejar}, cookie_jar => $config{cookiejar},
env_proxy => 1, # respect proxy env vars env_proxy => 1, # respect proxy env vars