commit 037d474360867a59831a7a75ee8709eca4a2fd47
Author: Kornel Benko <[email protected]>
Date:   Wed Jan 8 13:36:30 2014 +0100

    Cmake url tests: Use try - catch mechanism while testing urls.
    
    If a perl-submodule exits with 'die()', the process would stop
    and the following urls would not be tested.
    The bug detection and idea how to solve it: Scott Kostyshak.

diff --git a/development/checkurls/search_url.pl 
b/development/checkurls/search_url.pl
index 8de2324..1d88783 100755
--- a/development/checkurls/search_url.pl
+++ b/development/checkurls/search_url.pl
@@ -39,10 +39,12 @@ BEGIN  {
 }
 
 use CheckURL;
+use Try::Tiny;
+use locale;
+use POSIX qw(locale_h);
 
-$ENV{LC_ALL} = "en_US.UTF-8";
-$ENV{LANG} = "en_US.UTF-8";
-$ENV{LANGUAGE} = "en_US.UTF-8";
+setlocale(LC_CTYPE, "");
+setlocale(LC_MESSAGES, "en_US.UTF-8");
 
 my %URLS = ();
 my %ignoredURLS = ();
@@ -97,14 +99,22 @@ for my $u (@urls) {
   }
   next if ($checkSelectedOnly && ! defined($selectedURLS{$u}));
   $URLScount++;
-  print "Checking '$u'";
-  my $res = &check_url($u);
-  if ($res) {
-    print ": Failed\n";
-  }
-  else {
-    print ": OK\n";
+  print "Checking '$u': ";
+  my ($res, $prnt);
+  try {
+    $res = &check_url($u);
+    if ($res) {
+     $prnt = "Failed";
+    }
+    else {
+      $prnt = "OK";
+    }
   }
+  catch {
+    $prnt = "Failed, caught error: $_";
+    $res = 700;
+  };
+  print "$prnt\n";
   my $printSourceFiles = 0;
   my $err_txt = "Error url:";
 

Reply via email to