]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.refresh.monitor: Add exception handling in monitor-loop so that if
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 3 Nov 2015 05:36:10 +0000 (21:36 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 3 Nov 2015 05:36:10 +0000 (21:36 -0800)
a path isn't a valid vocabulary name then we print an error. Should spam
the console on windows downloads but 1) only for .com not the .exe, 2) we
prefer people to build from source in which case the :Zone.Identifier ADS
will not be present, and 3) it will educate people about ADS hopefully.

If it's annoying we can turn it off.

basis/vocabs/refresh/monitor/monitor.factor

index 8eee46f19c6acf85a9f7cf684cc0c9cead740852..dcd906a076fbd6a9d22167e4b4ff99cc154be5c7 100644 (file)
@@ -31,11 +31,17 @@ TR: convert-separators "/\\" ".." ;
     ! On OS X, monitors give us the full path, so we chop it
     ! off if its there.
     [
-        next-change path>> path>vocab
-        [ changed-vocab ] [ reset-cache ] bi
-    ]
-    [ monitor-loop ]
-    bi ;
+        next-change path>>
+        [
+            path>vocab
+            [ changed-vocab ] [ reset-cache ] bi
+        ] [
+            [
+                [ "monitor-loop warning for path ``" "``:" surround write ]
+                [ . ] bi* flush
+            ] with-global
+        ] recover
+    ] [ monitor-loop ] bi ;
 
 : (start-vocab-monitor) ( vocab-root -- )
     dup exists?
@@ -45,7 +51,12 @@ TR: convert-separators "/\\" ".." ;
     [
         dup '[
             [ _ (start-vocab-monitor) ]
-            [ [ _ "fatal error for monitor root ``" "``: " surround write . flush ] with-global ] recover
+            [
+                [
+                    _ "fatal error for monitor root ``" "``: " surround write
+                    . flush
+                ] with-global
+            ] recover
         ]
     ] [ "Root monitor: " prepend ]
     bi spawn drop ;