Fix tiny Makefile bug
[hcoop/domtool2.git] / src / main.sml
index f7b8346..aca57ed 100644 (file)
@@ -787,7 +787,13 @@ fun requestFirewall {node, uname} =
 
 fun regenerate context =
     let
+       val _ = ErrorMsg.reset ()
+
        val b = basis ()
+       val _ = if Env.lookupType b "string" then
+                   print "Still got it\n"
+               else
+                   print "Don't got it\n"
        val () = Tycheck.disallowExterns ()
 
        val () = Domain.resetGlobal ()
@@ -1253,8 +1259,15 @@ fun service () =
                            OpenSSL.close bio
                            handle OpenSSL.OpenSSL _ => ();
                            loop ())
-                        | _ =>
+                        | IO.Io {name, function, cause} =>
+                          (print ("IO error: " ^ function ^ " for " ^ name ^ "\n");
+                           app (fn x => print (x ^ "\n")) (SMLofNJ.exnHistory cause);
+                           OpenSSL.close bio
+                           handle OpenSSL.OpenSSL _ => ();
+                           loop ())
+                        | e =>
                           (print "Unknown exception in main loop!\n";
+                           app (fn x => print (x ^ "\n")) (SMLofNJ.exnHistory e);
                            OpenSSL.close bio
                            handle OpenSSL.OpenSSL _ => ();
                            loop ())