]> gitweb.factorcode.org Git - factor.git/commitdiff
error check run process
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 18 Apr 2008 18:42:56 +0000 (13:42 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 18 Apr 2008 18:42:56 +0000 (13:42 -0500)
related words in docs
use ERROR:

extra/editors/vim/vim.factor
extra/io/launcher/launcher-docs.factor
extra/io/launcher/launcher.factor

index 8d60942d67a2f63ea4ab01ae43577deff0da6d10..f632a478be16754cc73fc527092d28019b1eb65b 100755 (executable)
@@ -18,7 +18,7 @@ M: vim vim-command ( file line -- array )
 : vim-location ( file line -- )
     vim-command
     vim-detach get-global
-    [ run-detached ] [ run-process ] if drop ;
+    [ try-detached ] [ try-process ] if ;
 
 "vim" vim-path set-global
 [ vim-location ] edit-hook set-global
index 4446b82f208f2ffd91ebc0dacc7287b9234c71b2..dadb627fc073fcf2ce826438b61c858d7b3bf553 100755 (executable)
@@ -113,6 +113,8 @@ HELP: try-process
 { $values { "desc" "a launch descriptor" } }
 { $description "Launches a process and waits for it to complete. If it exits with a non-zero status code, throws a " { $link process-failed } " error." } ;
 
+{ run-process try-process run-detached } related-words
+
 HELP: kill-process
 { $values { "process" process } }
 { $description "Kills a running process. Does nothing if the process has already exited." } ;
@@ -171,6 +173,7 @@ ARTICLE: "io.launcher.launch" "Launching processes"
 "Launching processes:"
 { $subsection run-process }
 { $subsection try-process }
+{ $subsection run-detached }
 "Redirecting standard input and output to a pipe:"
 { $subsection <process-stream> }
 { $subsection with-process-stream } ;
index 9b480d0cc2974e1d4bc9987de6051c752d71ef7e..6ee866052866b8ef007215c15505806ca1b42471 100755 (executable)
@@ -127,10 +127,7 @@ HOOK: run-process* io-backend ( process -- handle )
     run-detached
     dup detached>> [ dup wait-for-process drop ] unless ;
 
-TUPLE: process-failed code ;
-
-: process-failed ( code -- * )
-    \ process-failed boa throw ;
+ERROR: process-failed code ;
 
 : try-process ( desc -- )
     run-process wait-for-process dup zero?