diff options
author | Matthew Somerville <matthew@mysociety.org> | 2014-11-05 16:56:32 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2014-11-05 17:07:47 +0000 |
commit | 80f12b9529dca6b2f425918fce77da41da168f41 (patch) | |
tree | 2de011bcff1d1c13341eebd608ee368bc25491f8 /perllib/FixMyStreet | |
parent | 92fc64655c5b51ddec3286befd87d9693ca718c2 (diff) |
Remove liberror-perl and libsoap-lite-perl.
Try and save other people the potential pain of installing SOAP::Lite;
only UK FixMyStreet and Zurich geocoder use it, so set it as an optional
feature in the cpanfile instead.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Zurich.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/EastHants.pm | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index 7ba3d27ad..84fd83fc7 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -16,7 +16,6 @@ use strict; use Digest::MD5 qw(md5_hex); use File::Path (); use Geo::Coordinates::CH1903; -use SOAP::Lite; use Storable; use mySociety::Locale; @@ -33,6 +32,8 @@ sub setup_soap { my $attr = 'http://ch/geoz/fixmyzuerich/service'; my $action = "$attr/IFixMyZuerich/"; + require SOAP::Lite; + # Set up the SOAP handler $security = SOAP::Header->name("Security")->attr({ 'mustUnderstand' => 'true', diff --git a/perllib/FixMyStreet/SendReport/EastHants.pm b/perllib/FixMyStreet/SendReport/EastHants.pm index beab9d55c..44bc084b1 100644 --- a/perllib/FixMyStreet/SendReport/EastHants.pm +++ b/perllib/FixMyStreet/SendReport/EastHants.pm @@ -4,11 +4,9 @@ use Moose; BEGIN { extends 'FixMyStreet::SendReport'; } -# export just what we need as error if we use :try -use Error qw(try otherwise); +use Try::Tiny; use Encode; use mySociety::Web qw(ent); -use EastHantsWSDL; sub construct_message { my %h = @_; @@ -37,6 +35,8 @@ sub send { # FIXME: should not recreate this each time my $eh_service; + require EastHantsWSDL; + $h->{category} = 'Customer Services' if $h->{category} eq 'Other'; $h->{message} = construct_message( %$h ); my $return = 1; @@ -50,8 +50,8 @@ sub send { '', '', '', '', '', '', $message, 'Yes', $h->{image_url} ); $return = 0 if $result eq 'Report received'; - } otherwise { - my $e = shift; + } catch { + my $e = $_; print "Caught an error: $e\n"; $self->error( "Error sending to East Hants: $e" ); }; |