- Templates.exnFn ();
- if Web.noOutput () then
- (print "Status: 500\nContent-type: text/plain\n\nAn exception!\n\n";
- app (fn s => print (s ^ "\n")) (SMLofNJ.exnHistory ex))
- else
- Web.output ();
+ (Templates.exnFn ();
+ if Web.noOutput () then
+ (print "Status: 500\nContent-type: text/plain\n\nUncaught exception:\n\n";
+ app (fn s => print (s ^ "\n")) (SMLofNJ.exnHistory ex))
+ else
+ Web.output ())
+ handle ex' => (print "Status: 500\nContent-type : text/plain\n\nUncaught exception:\n\n";
+ app (fn s => print ("\t" ^ s ^ "\n")) (SMLofNJ.exnHistory ex);
+ print "\nAnother exception raised in exception handler:\n\n";
+ app (fn s => print ("\t" ^ s ^ "\n")) (SMLofNJ.exnHistory ex'));