From: Adam Chlipala Date: Sun, 9 Dec 2007 13:25:40 +0000 (+0000) Subject: Slave catches all exceptions, to avoid dying X-Git-Tag: release_2010-11-19~98 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/7cf605360d59466490c6fb257ea3785c8b426954 Slave catches all exceptions, to avoid dying --- diff --git a/src/main.sml b/src/main.sml index ba60764..feaab16 100644 --- a/src/main.sml +++ b/src/main.sml @@ -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