]> git.etc.gen.nz Git - asterisk-agi-enum.git/commitdiff
Handle the case where the eval fails. 0.2
authorAndrew Ruthven <andrew@etc.gen.nz>
Tue, 13 Jan 2009 19:27:56 +0000 (08:27 +1300)
committerAndrew Ruthven <andrew@cerberus.etc.gen.nz>
Tue, 13 Jan 2009 19:27:56 +0000 (08:27 +1300)
Thanks Mahlon for pointing this out.

enum.agi

index a852aa18157d45cb163435f662c31b00d507eebb..38e8cced4ae6e4d0b59533da2bc6c176b87de99f 100644 (file)
--- a/enum.agi
+++ b/enum.agi
@@ -88,6 +88,10 @@ sub get_resources {
         $A->verbose( "$pattern, $replacement", 4 );
         my $regexp = "\$resource =~ s/$pattern/$replacement/";
         eval "$regexp";
+       if ($@) {
+          $A->verbose( "ENUM replacement faileD: $@", 1 );
+         next;
+       }
         $A->verbose( "new resource: $resource", 4 );
         $resource =~ s/^(\w+):/\U$1\//;
         $records{$count} =