How to return status code 500 on server crashes

1 view
Skip to first unread message

Maximillian Dornseif

unread,
Nov 2, 2009, 4:14:14 PM11/2/09
to MochiWeb
I created a webserver based on the mochiweb project skeleton and using
it wit a library which follows the "crash early, crash often"
paradigm. Which is a falid approach to build a system.

Unfortunately if a crash occures in the loop/2 function the server
closes the connection to the client without sending anything.

Can anybody suggest an approach to send a 500 status back to the
client in such situations?

--md

Bob Ippolito

unread,
Nov 2, 2009, 4:55:08 PM11/2/09
to moch...@googlegroups.com
try Exprs
catch
[Class1:]ExceptionPattern1 [when ExceptionGuardSeq1] ->
ExceptionBody1;
[ClassN:]ExceptionPatternN [when ExceptionGuardSeqN] ->
ExceptionBodyN
end
Reply all
Reply to author
Forward
0 new messages