Add new when-expression operators.
[whenjobs.git] / daemon / daemon.ml
index 3aee15a..eca0218 100644 (file)
@@ -166,7 +166,13 @@ and reevaluate_whenjobs jobnames =
             with Not_found -> assert false in
           assert (jobname = job.job_name);
 
-          let r, job' = job_evaluate job !variables in
+          let r, job' =
+            try job_evaluate job !variables
+            with Invalid_argument err | Failure err ->
+              Syslog.error "error evaluating job %s (at %s): %s"
+                jobname (Camlp4.PreCast.Ast.Loc.to_string job.job_loc) err;
+              false, job in
+
           jobs := StringMap.add jobname job' !jobs;
 
           if !debug then