Catch-all aliases working again
[hcoop/domtool2.git] / src / main.sml
index d769a61..feaab16 100644 (file)
@@ -176,7 +176,7 @@ fun eval fname =
            raise ErrorMsg.Error
        else
            Eval.exec (Defaults.eInit ()) body'
-      | NONE => raise ErrorMsg.Error
+      | NONE => ()
 
 fun eval' fname =
     case reduce fname of
@@ -185,7 +185,7 @@ fun eval' fname =
            raise ErrorMsg.Error
        else
            ignore (Eval.exec' (Defaults.eInit ()) body')
-      | NONE => raise ErrorMsg.Error
+      | NONE => ()
 
 val dispatcher =
     Config.dispatcher ^ ":" ^ Int.toString Config.dispatcherPort
@@ -288,7 +288,7 @@ fun requestDir dname =
        val (_, files) = Order.order (SOME b) files
 
        val _ = if !ErrorMsg.anyErrors then
-                   raise ErrorMsg.Error
+                   (print "J\n";raise ErrorMsg.Error)
                else
                    ()
 
@@ -1636,7 +1636,7 @@ fun slave () =
                          | _ => (OpenSSL.close bio;
                                  loop ())
                end handle OpenSSL.OpenSSL s =>
-                          (print ("OpenSSL error: "^ s ^ "\n");
+                          (print ("OpenSSL error: " ^ s ^ "\n");
                            OpenSSL.close bio
                                          handle OpenSSL.OpenSSL _ => ();
                            loop ())
@@ -1646,6 +1646,17 @@ fun slave () =
                            OpenSSL.close bio
                            handle OpenSSL.OpenSSL _ => ();
                            loop ())
+                        | IO.Io {function, name, ...} =>
+                          (print ("IO error: " ^ function ^ ": " ^ name ^ "\n");
+                           OpenSSL.close bio
+                           handle OpenSSL.OpenSSL _ => ();
+                           loop ())
+                        | e =>
+                          (app (fn s => print (s ^ "\n")) (SMLofNJ.exnHistory e);
+                           print "Uncaught exception!\n";
+                           OpenSSL.close bio
+                           handle OpenSSL.OpenSSL _ => ();
+                           loop ())
     in
        loop ();
        OpenSSL.shutdown sock