Handle the case where the eval fails.
[asterisk-agi-enum.git] / 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} =