diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/part_export/globalpops_voip.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/FS/FS/part_export/globalpops_voip.pm b/FS/FS/part_export/globalpops_voip.pm index b6e713ac9..52a4ec2a1 100644 --- a/FS/FS/part_export/globalpops_voip.pm +++ b/FS/FS/part_export/globalpops_voip.pm @@ -60,21 +60,23 @@ sub get_dids { } my $dids = $self->gp_command('getDIDs', %getdids); + if ( $dids->{'type'} eq 'Error' ) { - die "Error running VoIP Innovations getDIDs: ". - $search->{'statuscode'}. ': '. $search->{'status'}; #die?? + my $error = "Error running VoIP Innovations getDIDs: ". + $dids->{'statuscode'}. ': '. $dids->{'status'}. "\n"; + warn $error; + die $error; } - #use Data::Dumper; - #warn Dumper($dids); - my $search = $dids->{'search'}; if ( $search->{'statuscode'} == 302200 ) { return []; } elsif ( $search->{'statuscode'} != 100 ) { - die "Error running VoIP Innovations getDIDs: ". - $search->{'statuscode'}. ': '. $search->{'status'}; #die?? + my $error = "Error running VoIP Innovations getDIDs: ". + $search->{'statuscode'}. ': '. $search->{'status'}. "\n"; + warn $error; + die $error; } my @return = (); @@ -246,7 +248,10 @@ sub gp_command { my( $self, $command, @args ) = @_; eval "use Net::GlobalPOPs::MediaServicesAPI;"; - die $@ if $@; + if ( $@ ) { + warn $@; + die $@; + } my $gp = Net::GlobalPOPs::MediaServicesAPI->new( 'login' => $self->option('login'), |