Permalink
Browse files

Make crashmsg set status code 500

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1233 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 9bda554 commit 9abef82cae091a7fa30073b4ff77b77ad14488aa @klacke committed Apr 21, 2008
Showing with 3 additions and 1 deletion.
  1. +2 −1 src/yaws_404.erl
  2. +1 −0 src/yaws_server.erl
View
@@ -60,7 +60,8 @@ not_found_body(Path, _GC, _SC) ->
%% while developing
%% it's extremely convenient to get the crash messages in the browser,
%% however not in production :-)
-
+%% This function can only return an {ehtml, EH} or an {html, HTML}
+%% value, no status codes, no headers etc.
crashmsg(_Arg, _SC, L) ->
{ehtml,
[{h2, [], "Internal error, yaws code crashed"},
View
@@ -2669,6 +2669,7 @@ handle_crash(ARG, L) ->
?Debug("handle_crash(~p)~n", [L]),
SC=get(sc),
yaws:elog("~s", [L]),
+ yaws:outh_set_status_code(500),
case catch apply(SC#sconf.errormod_crash, crashmsg, [ARG, SC, L]) of
{html, Str} ->
accumulate_content(Str),

0 comments on commit 9abef82

Please sign in to comment.