let
val _ = Cgi.init ()
val cgiFields = Cgi.cgi_fieldnames ()
- fun mapper name = (name, valOf (Cgi.cgi_field_string name))
+ fun mapper name = (name, Cgi.cgi_field_strings name)
in
Web.pushParams (map mapper cgiFields);
case args of
| SOME f => (f ();
Web.output ();
OS.Process.success))
- end handle ex => (print "Status: 500\nContent-type: text/plain\n\nAn exception!\n\n";
+ end handle Fail msg => (print "Status: 500\nContent-type: text/plain\n\nFatal error: \n\n";
+ print msg;
+ OS.Process.failure)
+ | ex => (print "Status: 500\nContent-type: text/plain\n\nAn exception!\n\n";
app (fn s => print (s ^ "\n")) (SMLofNJ.exnHistory ex);
OS.Process.failure)
end
\ No newline at end of file