about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xnotyet14
1 files changed, 9 insertions, 5 deletions
diff --git a/notyet b/notyet
index 2745656..bb6b769 100755
--- a/notyet
+++ b/notyet
@@ -145,11 +145,15 @@ def parse(io, filename=nil)
       if desc =~ /^#exec\s+(.+)/
 # - error handling for #exec
         Dir.chdir(File.dirname(fname)) {
-          IO.popen($1) { |f|
-            sub = parse(f, $1)
-            sub.reindent(i+2)
-            children = sub.children
-          }
+          begin
+            IO.popen($1) { |f|
+              sub = parse(f, $1)
+              sub.reindent(i+2)
+              children = sub.children
+            }
+          rescue SystemCallError => e
+            children = [Entry.new(i+2, "?", "ERROR: #{e}", fname, lineno, [])]
+          end
         }
         next  if children.empty?
       elsif desc =~ /^#include\s+(\S+)/