(no commit message)
[vsys.git] / backend.ml
index 7d00cfd..690f1c6 100644 (file)
@@ -58,8 +58,13 @@ class backendHandler dir_root (frontend_lst: frontendHandler list) =
        let s = Unix.stat fqp in
          List.iter 
            (fun frontend->
-              frontend#mkdir (mk_rel_path fqp) (s.st_perm);
-              Dirwatcher.add_watch fqp [S_Create;S_Delete] (Some(func)))
+              try begin 
+                frontend#mkdir (mk_rel_path fqp) (s.st_perm);
+                Dirwatcher.add_watch fqp [S_Create;S_Delete] (Some(func)) 
+              end
+              with _ ->
+                fprintf logfd "Could not create %s. Looks like a slice shot itself in the foot\n" fqp;flush logfd;
+           )
            slice_list
 
      (** Somebody copied in a new script *)
@@ -166,7 +171,7 @@ class backendHandler dir_root (frontend_lst: frontendHandler list) =
                        | S_REG ->
                            this#new_script slice_list fqp
                        | _ ->
-                           printf "Don't know what to do with %s\n" curfile;flush Pervasives.stdout
+                           fprintf logfd "Don't know what to do with %s\n" curfile;flush logfd
                    end
            with 
                _->cont:=false;()